Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Problems with namespace [Thread Next] Re: Problems with namespaceTo: NULL Date: 5/27/2009 12:39:00 PM Alhambra Eidos Development wrote:
> <?xml-stylesheet type="text/xsl" href="polizas.xsl"?>
> <POLIZAS xsi:schemaLocation="http://www.reale.es/monitorizacionb2b/ejemplo1
> Polizas.xsd" xmlns="http://www.reale.es/monitorizacionb2b/ejemplo1"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Because of this default namespace declaration the elements in your XML
are in the namespace http://www.reale.es/monitorizacionb2b/ejemplo1.
Therefore your stylesheet needs to bind a prefix to that namespace and
use that prefix in XPath expressions and match patterns to qualify
element names e.g.
> <xsl:stylesheet version="1.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:msxsl="urn:schemas-microsoft-com:xslt"
> xmlns:ms="urn:schemas-microsoft-com:xslt"
> xmlns="http://www.reale.es/monitorizacionb2b/ejemplo1" >
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Remove that line and use
xmlns:ej="http://www.reale.es/monitorizacionb2b/ejemplo1"
instead then
>
> <xsl:output method="html"/>
>
> <xsl:template match="POLIZAS">
<xsl:template match="ej:POLIZAS">
>
> <html>
> <body>
> <h1>Datos Principales</h1>
>
> <h4>Id Mediador: <xsl:value-of select="ID_MEDIADOR"/></h4>
<xsl:value-of select="ej:ID_MEDIADOR"/>
and so on.
--
Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
