Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Resolving QName with XSLT 1.0

From: Geert Josten <Geert.Josten@----------->
To:
Date: 12/1/2004 2:54:00 PM
Hi Chizzolini Stefano,



It is even worse, 'eur:invoice' is an attribute _value_. I don't think XSLT rec. defines anything 
like namespaces for attribute values.



But you are not totally at loss. You could look for a namespace node with the specified namespace 
prefix and test wether the value of that nodes matches the namespace uri you are looking for.



It should be something like:



<xsl:variable name="att-value-prefix" select="substring-before(@xsi:type, ':')" />
<xsl:if test="namespace::*[name() = $att-value-prefix][. = 'http://www.aaa.it/europa/xdm']">
  <!-- match! -->
</xsl:if>

Grtz





Hi all



I'm attempting to construct an xpath expression to select in my xml instance
a document element whose category subelement attribute xsi:type matches a
QName (say: "eur:invoice"), as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>
<documents
xmlns="http://www.aaa.it/consulta/xdmModel"
xmlns:eur="http://www.aaa.it/europa/xdm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0">
 <document id="kjsdlkj">
  <category xsi:type="eur:invoice">
   [...]
  </category>
 </document>
 [...]
</documents>

My question is: as the QName is not a simple literal (you know: the
namespace prefix isn't relevant by itself), how can I be sure that my
predicate matches "eur:invoice" as an expanded name
({http://www.aaa.it/europa/xdm}invoice) instead of the arbitrary
"eur:invoice" string?
Keep in mind that I'm using MSXML4 (XSLT 1.0 support), so it seems not to be
available the resolve-QName function described in the XSLT 2.0 spec
(http://www.w3.org/TR/xpath-functions/#func-resolve-QName).

What could I do in this case?



Many thanks



Stefano








--
Geert.Josten@xxxxxxxxxxx
IT-consultant at Daidalos BV, Zoetermeer (NL)

http://www.daidalos.nl/
tel:+31-(0)79-3316961
fax:+31-(0)79-3316464

GPG: 1024D/12DEBB50


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