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

Re: an elements schema context via xslt

Subject: Re: an elements schema context via xslt
From: Arian Hojat <arianhojat2000@xxxxxxxxx>
Date: Thu, 30 Jun 2005 09:31:15 -0700 (PDT)
xsd is else
Hey,
Couldn't you apply an xsl on just the schema doc?
prob alot more complex than this. Especially if you
split it up into many xsd's then I am not sure to
check ALL the documents via document() for matches. 
But this is my best guess (and I stink at guessing
hehe).

Psuedocode:

I use // cause of all the choice and sequence elements
that might parent the nodes.

match="xsd:group"
{
if has @name
apply templates select="//xsd:element"
else if has @ref
 {
 $var = @ref
 apply templates select="//xsd:group[@name=$var]"
 }
}

match="xsd:element"
{
if has @name, output "it can have this element "+@name
else if has @ref
 {
 $var = @ref
 apply templates select="/*//xsd:element[@name=$var] |
.//xsd:group"
 apply templates
select="xsd:attribute|xsd:attributeGroup"
 }
}

match="xsd:attributeGroup"
{
if has @name
apply-templates select="/*//xsd:attributeGroup |
.//xsd:attribute"
else if has @ref
{
 $var = @ref
 apply-templates
select="/*//xsd:attributeGroup[@name=$var]"|
.//xsd:attribute"
 }
}

match="xsd:attribute"
{
output "It can have this attribute"+@name 
}





--- Jan Limpens <jan.limpens@xxxxxxxxx> wrote:

> Hi everyone,
> 
> I wonder if it is possible (with a reasonable amount
> of code) to find
> out (given a xml document, the xpath to an element
> in this doc and the
> schema (xsd) document upon which the document is/was
> created), to find
> out which are the possible child- (and sibling- and
> attribute-)
> elements for the given element - using xslt. I am
> building a web based
> xml source editor for xml files and would like to
> provide some
> intellisense - alike functionality.
> 
> I am using the .net xslt transformer, but could also
> use the saxon.net
> port if that would help in this situation.
> 
> If I am just missing something simple to do this
> imperatively (by
> coding c#), I'd be also happy to hear. :)
> 
> Thanks a lot
> 
> -- 
> Jan
> http://www.limpens.com
> 
> Otakoo Saloon Cartoon - newest episode at
> http://otakoo-saloon-cartoon.com
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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.