Home > OS >  Is the XSLT processor connecting to the defined namespace reference?
Is the XSLT processor connecting to the defined namespace reference?

Time:04-02

when a XSLT-transformation is running, what does the XSLT-processor during parsing the namespace?

Here an example of a part of a stylesheet:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

Does then the processor is getting connected to http://www.w3.org/1999/XSL/Transform ? I'm asking in context of security if the reference is compromised.

CodePudding user response:

No, it will not connect to http://www.w3.org/1999/XSL/Transform and download anything.

XML namespaces are strings. Their only purpose is to be unique. The XML specification states that they follow the URI format, i.e. a superset of web URLs, but for all practical purposes in the context of XML, they are strings without any deeper meaning attached.

Nothing in the mechanism behind XML namespaces requires downloading anything form an external source, and no XSLT processor or XML parser will ever attempt to treat a namespace as a URL or a filename.

URLs are unique, they belong to an organization, they are easy to tell apart, and you could even store human-readable information there if you wanted to. So they are more practical to humans than, say, random GUIDs. But for XML parsers, they only are strings that allow making a difference between <foo xmlns="namespace1" /> and <foo xmlns="namespace2" />. That namespace1 potentially maybe also is a web address is completely irrelevant to the XML parser.

  • Related