problem transform xml withxslt (beginner)

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
hello.<br/>
I wish transform an xml into another xml with the addition of a namespace and the cancellation of a prefix ex:.<br/>
ex:<br/>
<?xml version="1.0" encoding="UTF-8"?><br/>
<ex:iso_10303_28 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ex="urn:iso.org:standard:10303:part(28):version(2):xmlschema:common" xsi:schemaLocation="urn:iso.org:standard:10303:part(28):version(2):xmlschema:common
ex.xsd" version="2.0 <br/>
<ex:iso_10303_28_header><br/>
<ex:name>C:modelli postIFC2.ifcxml</ex:name><br/>
<ex:time_stamp>2010-06-09T11:31:11</ex:time_stamp><br/>
<ex:author>Giuseppe Ferrari</ex:author><br/>
<ex:organization></ex:organization><br/>
<ex:authorization></ex:authorization><br/>
<ex:originating_system>Allplan 2009.0 15.03.2010 - 13:23:58</ex:originating_system><br/>
<ex:preprocessor_version>Express Data Manager Version 4.7.065 Oct 30 2006</ex:preprocessor_version><br/>
<ex:documentation>IFC2x3 Coordination View</ex:documentation><br/>
</ex:iso_10303_28_header><br/>
<ex:uos id="uos_1" description="" configuration="i-ifc2x3" edo=""
<br/>
xmlns:ex="http://www.iai-tech.org/ifcXML/IFC2x3/FINAL"
<br/>
xsi:schemaLocation="http://www.iai-tech.org/ifcXML/IFC2x3/FINAL IFC2X3.xsd <br/>
<IfcAxis2Placement3D id="i1556 <br/>
<Location><br/>
<IfcCartesianPoint id="i1584 <br/>
<Coordinates ex:cType="list <br/>
<IfcLengthMeasure ex:pos="0 0.</IfcLengthMeasure><br/>
<IfcLengthMeasure ex:pos="1 0.</IfcLengthMeasure><br/>
<IfcLengthMeasure ex:pos="2 0.</IfcLengthMeasure><br/>
</Coordinates><br/>
</IfcCartesianPoint><br/>
</Location><br/>
</IfcAxis2Placement3D><br/>
<br/>
this <br/>
<ex:uos id="uos_1" description="" configuration="i-ifc2x3" edo=""
<br/>
xmlns:ex="urn:iso.org:standard:10303:part(28):version(2):xmlschema:common"<br/>
xsi:schemaLocation="http://www.iai-tech.org/ifcXML/IFC2x3/FINAL IFC2X3.xsd <br/>
become:<br/>
<uos id="uos_1" description="" configuration="i-ifc2x3" edo=""
<br/>
xmlns:ex="urn:iso.org:standard:10303:part(28):version(2):xmlschema:common"<br/>
xsi:schemaLocation="http://www.iai-tech.org/ifcXML/IFC2x3/FINAL IFC2X3.xsd <br/>
xmlns:ifc="http://www.iai-tech.org/ifcXML/IFC2x3/FINAL" <br/>
<br/>
this is added:<br/>
xmlns:ifc="http://www.iai-tech.org/ifcXML/IFC2x3/FINAL" <br/>
and this :<br/>
<ex:iso_10303_28<br/>
become <br/>
<iso_10303_28<br/>
<br/>
and all IfcLenghtMeasure elements : <br/>
<IfcAxis2Placement3D id="i1556 <br/>
<Location><br/>
<IfcCartesianPoint id="i1584 <br/>
<Coordinates ex:cType="list <br/>
<IfcLengthMeasure ex:pos="0 0.</IfcLengthMeasure><br/>
<IfcLengthMeasure ex:pos="1 0.</IfcLengthMeasure><br/>
<IfcLengthMeasure ex:pos="2 0.</IfcLengthMeasure><br/>
</Coordinates><br/>
</IfcCartesianPoint><br/>
</Location><br/>
</IfcAxis2Placement3D><br/>
become<br/>
<IfcAxis2Placement3D id="i1556 <br/>
<Location><br/>
<IfcCartesianPoint id="i1584 <br/>
<Coordinates ex:cType="list <br/>
<IfcLengthMeasure pos="0 0.</IfcLengthMeasure><br/>
<IfcLengthMeasure pos="1 0.</IfcLengthMeasure><br/>
<IfcLengthMeasure pos="2 0.</IfcLengthMeasure><br/>
</Coordinates><br/>
</IfcCartesianPoint><br/>
</Location><br/>
</IfcAxis2Placement3D><br/>
all<br/>
ex:pos="1"<br/>
become <br/>
pos="1" <br/>
Is possible?<br/>
all the xml must remain the same without these changes.<br/>
ps.
can you advice to me a good book on xml , xslt transformation?
thanks.

View the full article
 
Back
Top