[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: question on default namespace

Subject: RE: question on default namespace
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 9 Mar 2009 13:23:51 -0000
RE:  question on default namespace
The xpath-default-namespace attribute can be set on any XSLT element (not
only xsl:stylesheet), so if different regions of your stylesheet are
handling different source documents, you can set it differently for that
part of your code. Setting the value to the empty string causes the default
namespace to be "no namespace".

Michael Kay

> -----Original Message-----
> From: Torsten Schassan [maileslto:schassan@xxxxxx] 
> Sent: 09 March 2009 13:10
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  question on default namespace
> Hash: SHA1
> Hi,
> I tried to transform a document with a default namespace. In 
> the result I wanted to include the contents of another 
> document that is in no namespace. The xslt-snippet below 
> didn't work, only when I deleted the xpath-default-namespace 
> and added to all elements processed the namespace it worked. 
> Are there any other solutions that include the 
> xpath-default-namespace?
> XSLT extract:
> <xsl:stylesheet version="2.0"
> 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns:tei="http://www.tei-c.org/ns/1.0"
> 	xpath-default-namespace="http://www.tei-c.org/ns/1.0"
> 	exclude-result-prefixes="tei">
> [...some templates here...]
> <xsl:for-each
> select="document('http://diglib.hab.de/mss/10-aug-4f/facsimile
> .xml')//facsimile">
>   <xsl:copy-of select="."/>
> </xsl:for-each>
> Neither does this work, nor any <xsl:apply-templates> nor the 
> immediate <xsl:copy-of select="document('...')//facsimile"/>
> Can I "reset" an xpath to no use of a namespace?
> Best, Torsten
> - --
> Torsten Schassan
> Herzog August Bibliothek, Postfach 1364, D-38299 Wolfenbuettel
> Tel.: +49-5331-808-130, schassan {at} hab.de
>   http://www.hab.de; http://www.hab.de/forschung/projekte/weiss64.htm
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> vnTvcx9XKgdVZ8S4zxmEOCU=
> =rwuj

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.