The xmlns is designed so that people can accept different incoming data from multiple sources, and know what each part is for. For example, a different source might also provide comment nodes, but want them processed in a different way.
Thank you. I understand this now. The references I was reading on this were outdated or incomplete.
In order for your xsl to recognize what to do in each case, the namespaces can be declared in the xslt.
1. Add xmlns:ab="http://..." in the stylesheet node. (ab chosen at random)
2. When referencing the node using any xpath, add the prefix before.
As I understand this, it requires that I create and maintain a namespace document at the given URL referenced by "ab". This is a bit beyond my current level of proficiency and desire (see the comments below the %%%%).
To have it work with all comment nodes, you can use the local-name() function.
- <xsl:template match="*[local-name() = 'comment']">
-
<p><xsl:value-of select="*[local-name() = 'entry']"/></p>
-
</xsl:template>
This is a bit more at a level I can understand. However, I tried using it to process one node in the XML with only limited success.
%%%%
The scope of my task was to write a general purpose, XSLT engine based XML input routine for an application that graphs scientific/engineering data. The XML data was provided by a third party. I was not expecting to run into the problem I posted ... it almost made me think, my routine was just not working at all.
I now understand, the problem is not with my routine, rather with how the declarations are presented in the XML/XSL files. I also understand, this is not a problem that I can handle as in a "one-size-fits-all" way in my input routine. When a specific namespace declaration exists in an XML, prior to processing through my routine, each user will have to go through the steps to a) remove that namespace declaration in their XML file, b) declare their own namespace to work with their XML+XSL+my routine, or c) use local-name() functions in their XSL. I can leave this choice up to the user -- my part of the project is done.
I am still unsure why my test use of the local-name() function did not work completely, however I suspect it may be due to some sloppy XSL coding on my part ... something I will eventually get past by ongoing trial and error learning.
Thank you for your clarification and help on this - it has saved me from having to write yet another pre-processing filter on my general purpose routine.