XSLT failing with ACORD element

admin

Administrator
Staff member
Hello,

It is my first day with XSLTs/XML and I am unable to figure out what seems to be an easy problem. I am trying to pull a node and its children from an XML file.

I am using this:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="">
<xsl:copy-of select="//PersPolicy"/>
</xsl:template>
</xsl:stylesheet>


PersPolicy is what I am trying to pull. Now, my XML file has a SOAP wrapper -- essentially just elements with soap: xmlns -- which didn't seem to be a problem and one element called ACORD. ACORD is some strange insurance standard that I, an XML rookie, do not understand. Furthermore, I do not understand why, if I comment the tag out, my XSLT works. With the ACORD element in place, XMLSpy refuses to apply the XSLT.

The ACORD tag looks like this and encompasses the entire XML file aside from the soap header.

<ACORD xmlns="http://www.ACORD.org/standards/PC_Surety/ACORD1.8.0/xml/">
...
</ACORD>


The XSLT will also work if I fudge around with the ACORD's xmlns tag, like so:

<ACORD xmlns:myFudging="http://www.ACORD.org/standards/PC_Surety/ACORD1.8.0/xml/">
...
</ACORD>


Notice the "myFudging" that originally was not there.

Does anyone know what my problem may be, how to get around it, or how to deal with ACORD? I am only concerned with extracting the PersPolicy element and it's children, an element that resides within the ACORD node.

Thanks for reading,

Chad


P.S. I have read a little about a technology called SAX that is supposed to be good for filtering like this. I, unfortunately do not have time to learn it, nor can it be applied here. The XML i am using comes straight from a mainframe into Rational Robot. The XSLT needs to be done on the fly and I cannot use another technology (like SAX or Ruby) as an intermediary to filter out the tag.
 
Back
Top