[Home] [By Thread] [By Date] [Recent Entries]
Hi Antsnio,
The prefix is a placeholder for the namespace. In your case, the namespace is http://www.w3.org/2001/XMLSchema. It does not matter what prefix is used in the XML document. To make sure XSL understands the same namespace, all you have to do is put the following in your stylesheet declaration: <xsl:stylesheet version="1.0" xmlns:yourprefix="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> This namespace can now be used in you XPaths. This works for both 1.0 and 2.0 XSLT. It does not matter what prefix you use. If, for instance, the source XML looks like this (I assume you want to parse an XMLSchema document): <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > you can reference elements inside this schema like this: <xsl:value-of select="//yourprefix:simpleType" /> to get all simpleType elements from the source. These will be visible like "xs:simpleType" in the source document. If you want to remove the prefixes to the output stream, you can expand the opening element of the xslt as follows: <xsl:stylesheet version="1.0" exclude-result-prefixes="yourprefix xsl" xmlns:yourprefix="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> But this is not guaranteed to work always because of the "namespace fixup process" at the end of the XSLT transformation. Cheers, Abel Braaksma http://www.nuntia.nl Antsnio Mota wrote: Hello all:
|

Cart



