Hello,
I am using
<xsl:template match="my_element_name">
to get match my XML elements, the problem is that the elements all have namespaces so the will look like "ab:my_element_name". When I try to match it nothing will happen and I am only able to process the node when I take remove the namespace from the XML file and just process the "my_element_name".
this is the xsd file "extracted and changed"
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0" exclude-result-prefixes="xs xdt err fn"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
xmlns:err="http://www.w3.org/2005/xqt-errors"
xmlns:be="http://some valid address">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="my_element_name">
<!--create the element with its attributes-->
<xsl:element name="my_new_element_name">
<xsl:attribute name="my_attrib1">
<xsl:value-of select="my_element_name2"/>
</xsl:attribute>
<xsl:attribute name="my_attrib2"/>
<xsl:attribute name="my_attrib3"/>
<xsl:element name="my_other_new_element">
<xsl:apply-templates/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
with out namespace
Code:
<?xml version="1.0" encoding="UTF-8"?>
<my_element_name identifier="">
<my_element_name2>some stuff</my_element_name2>
.....
.....
</my_element_name>
with namespace
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ab:my_element_name identifier="" xmlns:ab="some address" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="some address">
<ab:my_element_name2>be:soknadid</ab:my_element_name2>
....
.....
</ab:my_element_name>
why can't I process the elements with namespaces?
thanks,
es