New to the whole xml thing and finding w3schools to be an excellent resource.
Now down to my question:
I have several xml files I need to parse through and grab relevant information from and produce a new xml file. This needs to be automated through ant.
The ant script is working fine, and I am usign the <transform> function to use my xslt file and go through all the required xml files, parse them, style them, and ultimately generate my xml file with pertenant information.
example of one of several xml files I am parsing
<binding name="commonarr angementservici ng"
<opeartion name="retrieveP roductArrangeme ntListByClient" >
</operation>
<operation name="retrieveR elatedCreditCar dArrangementIde ntifiers">
</operation>
</binding>
<service name="commonarr angementservici ngService">
</service>
I need my xslt to be formatted as follows:
<service name>name = {the name from the xml file I'm parsing}
<operation name>name = {name from xml file I'm parsing}
</opeartion name>
<operation name>name = {name from xml file I'm parsing}
</opeartion name>
....
</service name>
theo nly way I understand how to do anything close to this in xslt is this:
<xslt:templat e match="wsdl:ser vice | wsdl:operation" > <-- parse through for only instance of <service> and <operation>
<service>
<xslt:element name="serviceNa me">
<xslt:value-of select="@name" />
</xslt:element>
<xslt:element name="operation Name">
<xslt:value-of select="@name"/>
</xslt:element>
</service>
the problem is that both attributes share the common variable "name" so I can't explicitely call the service attribute from the xml file and the operation attribute separately. The result is I get the same result twice. One for "service" and one for "operation"
I apologize if the question is unclear, just let me know what you don't get and I will try to explain it further. (also be kind, I'm new at this :) )
Thank's in advance to all that help.
Now down to my question:
I have several xml files I need to parse through and grab relevant information from and produce a new xml file. This needs to be automated through ant.
The ant script is working fine, and I am usign the <transform> function to use my xslt file and go through all the required xml files, parse them, style them, and ultimately generate my xml file with pertenant information.
example of one of several xml files I am parsing
<binding name="commonarr angementservici ng"
<opeartion name="retrieveP roductArrangeme ntListByClient" >
</operation>
<operation name="retrieveR elatedCreditCar dArrangementIde ntifiers">
</operation>
</binding>
<service name="commonarr angementservici ngService">
</service>
I need my xslt to be formatted as follows:
<service name>name = {the name from the xml file I'm parsing}
<operation name>name = {name from xml file I'm parsing}
</opeartion name>
<operation name>name = {name from xml file I'm parsing}
</opeartion name>
....
</service name>
theo nly way I understand how to do anything close to this in xslt is this:
<xslt:templat e match="wsdl:ser vice | wsdl:operation" > <-- parse through for only instance of <service> and <operation>
<service>
<xslt:element name="serviceNa me">
<xslt:value-of select="@name" />
</xslt:element>
<xslt:element name="operation Name">
<xslt:value-of select="@name"/>
</xslt:element>
</service>
the problem is that both attributes share the common variable "name" so I can't explicitely call the service attribute from the xml file and the operation attribute separately. The result is I get the same result twice. One for "service" and one for "operation"
I apologize if the question is unclear, just let me know what you don't get and I will try to explain it further. (also be kind, I'm new at this :) )
Thank's in advance to all that help.
Comment