Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Problems with namespace

From: Martin Honnen <mahotrash@-----.-->
To: 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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent