xsl-list
[Top] [All Lists]

Re: [xsl] Grouping - using Referenced Schema

2007-03-16 08:39:38
Karthik,

Why not bind your namespaces to prefixes in the usual way and use them accordingly?

This doesn't appear to me to be about schemas as such, but only about the fact that your elements are in a namespace. So

<xsl:stylesheet xmlns:xys="http://ABC/XYZ"; xmlns:xyy="http://ABC/XYY";
  xmlns:qwe="http://ABC/QWE"; ...

...

<xsl:variable name="unique-countries" select="/xyz:cities/xyy:city[not(qwe:country=preceding-sibling::xyy:city/qwe:country)]/qwe:country"

(Though one would hope that each of these three element types would not be in its own peculiar namespace.)

The important point here is that the namespace prefixes don't have to be identical with those in the source documents as long as the namespace bindings themselves line up.

Are we missing something?

Cheers,
Wendell

At 10:50 AM 3/16/2007, you wrote:
Hi,

I am new to XSLT. I have to group based on a node.

The source schema is a referenced Schema hence I am using Qualified
Name in XPath.

In a normal scenario we will use like

<xsl:variable name="unique-countries"
select="//cities/city[not(country=preceding-sibling::city/country)]/country"
/>

If using referenced schema then how to use the preceding sibling ???

<xsl:variable name="unique-countries"
select="/*[local-name()='cities' and
namespace-uri()='http://ABC/XYZ']/[local-name()='city' and
namespace-uri()='http://ABC/XYY'][not(country=preceding-sibling::city/country)]/*[local-name()='country'
and namespace-uri()='http://ABC/QWE']" />


Thanks in advance

--
Thanks,
Karthik

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>