You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by ajay bhadauria <ab...@yahoo.com> on 2009/11/30 17:19:48 UTC

How to achieve in xslt equivalent to xs:any in xerces

Hi all,

As we have xs:any in xerces for any namespace usage , how do I achieve in xslt ? I could not find any construct in xsl as we have in schema language.

Could you please tell me,  is there any way we can achieve the same thing like xs:any ??

Regards
Ajay  


      

Re: How to achieve in xslt equivalent to xs:any in xerces

Posted by ke...@us.ibm.com.
> So it seems to mean a new XSLT 2.0 processor has been released about
> two weeks ago?
> 
> http://www.ibm.com/common/ssi/rep_ca/1/897/ENUS209-391/ENUS209-391.PDF

Yes, though it's only available as part of the Websphere environment.

(Don't bother asking me whether it will be available through other 
channels. I honestly don't know, and if I did I couldn't say so anyway.)

______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish (
http://www.ovff.org/pegasus/songs/threes-rev-11.html)

Re: How to achieve in xslt equivalent to xs:any in xerces

Posted by Michael Ludwig <mi...@gmx.de>.
keshlam@us.ibm.com schrieb am 01.12.2009 um 09:13:46 (-0500):
> 
> It means I've been involved with IBM's new XML Feature Pack for
> Websphere, which supports the 2.0 versions; hence my carelessly
> suggesting a 2.0-only solution.

So it seems to mean a new XSLT 2.0 processor has been released about
two weeks ago?

http://www.ibm.com/common/ssi/rep_ca/1/897/ENUS209-391/ENUS209-391.PDF

-- 
Michael Ludwig

Re: How to achieve in xslt equivalent to xs:any in xerces

Posted by ke...@us.ibm.com.
> Does that mean Xalan's going 2.0?

It means I've been involved with IBM's new XML Feature Pack for Websphere, 
which supports the 2.0 versions; hence my carelessly suggesting a 2.0-only 
solution.

Re: How to achieve in xslt equivalent to xs:any in xerces

Posted by Michael Ludwig <mi...@gmx.de>.
keshlam@us.ibm.com schrieb am 30.11.2009 um 11:46:31 (-0500):
> > Pretty sure XPath 1.0 [1] only allows foo:* wildcards (but not
> > *:foo).
> 
> ... Right. Sorry; too much time working on 2.0 recently.

Does that mean Xalan's going 2.0?

-- 
Michael Ludwig

Re: How to achieve in xslt equivalent to xs:any in xerces

Posted by ke...@us.ibm.com.
> Pretty sure XPath 1.0 [1] only allows foo:* wildcards (but not *:foo).

... Right. Sorry; too much time working on 2.0 recently.

The 1.0 equivalent would indeed be 
        *[localname()="foo"]

And, of course, if you want to ignore the name entirely, just matching on 
* will do that.

NOTE: Since the namespace is part of the semantics (meaning) of the 
document, ignoring it is usually an indicator of bad design (unless you're 
working in 2.0 and manipulating schema types rather than names). Think 
long and hard about what you're really trying to do and whether this is 
the best way to do it.

Re: How to achieve in xslt equivalent to xs:any in xerces

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
keshlam@us.ibm.com wrote on 11/30/2009 11:28:36 AM:

> > As we have xs:any in xerces for any namespace usage , how do I
> > achieve in xslt ? I could not find any construct in xsl as we have
> > in schema language.
>
> XSLT 1.0 and XPath 1.0 are not schema-aware. (That was added in the
> 2.0 version of these, which Xalan does not yet support.)
>
> If you want to match names without looking at the namespace, you can
> use wildcard QNames such as *:foo, or match on a wildcard and then
> qualify that with a predicate.

I believe that form [1] has only been supported since XPath 2.0. Pretty
sure XPath 1.0 [1] only allows foo:* wildcards (but not *:foo).

Thanks.

[1] http://www.w3.org/TR/xpath20/#prod-xpath-NameTest
[2] http://www.w3.org/TR/xpath#NT-NameTest

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Re: How to achieve in xslt equivalent to xs:any in xerces

Posted by ke...@us.ibm.com.
> As we have xs:any in xerces for any namespace usage , how do I 
> achieve in xslt ? I could not find any construct in xsl as we have 
> in schema language.

XSLT 1.0 and XPath 1.0 are not schema-aware. (That was added in the 2.0 
version of these, which Xalan does not yet support.)

If you want to match names without looking at the namespace, you can use 
wildcard QNames such as *:foo, or match on a wildcard and then qualify 
that with a predicate.