Re: [xsl] strip-spaces

Subject: Re: [xsl] strip-spaces
From: Steven Ericsson-Zenith <steven@xxxxxxxxxxxxx>
Date: Wed, 6 Feb 2008 08:37:12 -0800
Yes, I'd still want elements that are not processable to generate an error. I'm just thinking of a way to design multiple style sheets for processing documents that contain elements from a variety of name spaces - which we see fairly often these days. We have unique identifiers for name spaces - it would be useful to have associated style sheets for standard or specified translations.

Validating against a suitable schema is interesting but it doesn't provide a pointer to the methods to process the elements in a namespace. I imagine that I could have a convention in schemas that would provide such a pointer. Now that might actually work.

With respect,
Steven

On Feb 6, 2008, at 8:22 AM, David Carlisle wrote:



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