R
rosemm
i have a file which I get from a vendor. we are using a industry
schema, hr-xml. however, I can't seem to get any XPath expresions to
work when i receive the file. i think i have pinpointed the problem but
now I need a solution.
I have the following template
<xsl:template match="//PersonName">
<xsl:value-of select="normalize-space(FamilyName)"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="normalize-space(GivenName)"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="normalize-space(MiddleName)"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="normalize-space(Affix)"/>
<xsl:text>,</xsl:text>
</xsl:template>
The beginning of my xml file looks like this (this is where the problem
is)
<Enrollment xmlns="http://ns.hr-xml.org/2004-08-02"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ns.hr-xml.org/2004-08-02
Enrollment.xsd" creationDate="2005-03-31T11:47:26-06:00">
With this I get no data out of my file.
When I change that to
<Enrollment xmlns="creationDate="2005-03-31T11:47:26-06:00">
the above template works and I retrieve the names of everyone in the
file.
Anyone know exactly what the problem is and how I can fix it?
schema, hr-xml. however, I can't seem to get any XPath expresions to
work when i receive the file. i think i have pinpointed the problem but
now I need a solution.
I have the following template
<xsl:template match="//PersonName">
<xsl:value-of select="normalize-space(FamilyName)"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="normalize-space(GivenName)"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="normalize-space(MiddleName)"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="normalize-space(Affix)"/>
<xsl:text>,</xsl:text>
</xsl:template>
The beginning of my xml file looks like this (this is where the problem
is)
<Enrollment xmlns="http://ns.hr-xml.org/2004-08-02"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ns.hr-xml.org/2004-08-02
Enrollment.xsd" creationDate="2005-03-31T11:47:26-06:00">
With this I get no data out of my file.
When I change that to
<Enrollment xmlns="creationDate="2005-03-31T11:47:26-06:00">
the above template works and I retrieve the names of everyone in the
file.
Anyone know exactly what the problem is and how I can fix it?