I've been trying to loop attributes of a XML that have namespace, after sometime I was able to get elements using namespace, but now I'm getting a hard time to loop through attributes.
All examples I've found works without namespace on it.
This is what I have so far:
XSLT:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:x="TransactionDataOfRequest">
<xsl:output method="text" indent="no"/>
<xsl:output omit-xml-declaration="yes" encoding="UTF-8"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:for-each select="//x:form">
<xsl:value-of select="//x:name"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="/">
<xsl:copy-of select="//x:request"/>
<xsl:text> </xsl:text>
<!-- newline character -->
<xsl:value-of select="//x:qform"/>
</xsl:template>
</xsl:stylesheet>
XML:
<?xml version="1.0" encoding="iso-8859-1"?>
<transaction xmlns="TransactionDataOfRequest" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<success>true</success>
<code>0</code>
<value>
<request>INC000158</request>
</descript>
<qform>Save</qform>
<form>
<add name="ADM_1" title="B" type="String" isList="false">Americana</add>
<add name="ADM_2" title="Question?" type="String" isList="false">No</add>
<add name="ADM_3" title="State" type="String" isList="false">ss</add>
</form>
</value>
</transaction>