Say I have an XML file which looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Project xmlns="http://My/Project.xsd">
<Thing Name="test"/>
</Project>
And my XSLT is:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 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="http://My/Project.xsd">
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="Thing">
<xsl:value-of select="@Name"/>
</xsl:template>
</xsl:stylesheet>
The output is [NewLine][Tab][NewLine] which matches the spacing of the XML file.
If I change my XSLT to be: (added a prefix)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 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:N="http://My/Project.xsd">
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="N:Thing">
<xsl:value-of select="@Name"/>
</xsl:template>
</xsl:stylesheet>
The output is [NewLine][Tab]test[NewLine] which again matches the spacing of the XML file but includes the value of the "Name" attribute.
My expected output is simply test. No new lines, no tabs - it should not follow the format of the XML file at all.
I want to write the XML and XSLT without using prefixes. How can I make this output what I'm expecting?