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

Re: strip-spaces

Subject: Re: strip-spaces
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 6 Feb 2008 16:22:37 GMT
Re:  strip-spaces
> Is there a way to specify that a style  
> sheet processes only the elements of a particular name space? 

what do you mean by "processes only the elements of a particular name space"

do you want any element not in that namespace to generate an error or to
be silently ignored but have its children processed, or something els?

The first case you could do by validating against a suitable schema, or
by having default templates something like
<xsl:template match="*">
  <xsl:message terminate="yes">go away</xsl:message>
</xsl:template>

<xsl:template match="myns:*">
  default behaviour for myns
</xsl:template>


<xsl:template match="myns:foo">
  specific behaviour for myns:foo
</xsl:template>


The second case is XSLT's default behaviour.



> I now begin  to wonder how I specify operations on elements in a
> particular name space 

the namespace is part of the element name, so you almost always refer to
elements in a particular namespace in xpath (unless using the *
wildcard)

> but from what Michael has said it seems they are simply  
> "syntactic sugar"

namespaces are an intrinsic part of the model, but the namespace
declarations are just syntax (cf attribute values being part of the
model but choice of " or ' around attribute values is just syntax.
<a xmlns="z"><b></a> and <a xmlns="z"><b  xmlns="z"></a> 
generate identical input trees, just with different surface syntax that
is not observable using xpath, just as the differences between those and
<a xmlns='z'><b></a> and <a xmlns='z'><b  xmlns='z'></a> 
with ' instead of " is not observable.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.