Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSLT from a XSD spec.

From: "Gilgamesh" <josecarlos_gonzalez@-----.-->
To: NULL
Date: 10/4/2006 10:36:00 PM


Peter Flynn ha escrito:

Hi!

> Gilgamesh wrote:
> > Hi.
> >
> > I'm looking for an easy way to generate, automatically, an XSLT from an
> > XSD, to be applied to a XML file (conforming the previous XSD) and
> > generate an HTML.  Many of you will tell me that this is nonsense,
>
> Usually because there is no obvious way to know what HTML
> your <a1> element type ought to be output as, for example.
>

Yep, that should be fixed, say, to H1 .. H9, or to different levels of
indentation, corresponding to the different depth in the tree.

> There is an infinite number of ways of doing it, so how do
> you decide what is the "right" way for arbitrary XML.
>
> I agree that if the element type names have an accepted
> meaning in some language (eg <para>) then some of the
> decisions are obvious, but more often they are not.
>
> > I think it can be done, given the condition that the XML file (as
> > specified in the XSD) always has a root element (although it would be
> > nice if the root element name could be a parameter of the XSLT),
>
> The root element name of an XML document is always given
> by the XPath expression /*[1]/name()
>
> > and a
> > given hierarchy of sub-elements, until a level N where there is a list
> > of data elements, like this:
> >
> > <root>
> >   <a1>
> >     <b1>
> >       <c1>
> >         <d>D Value</d>
> >         <e>E Value</e>
> [snip]
>
> But what makes you think all document types follow this pattern?
> What you ask for may be valid for a very restricted subset of highly
> specialist document types, but here's a paragraph of the kind of
> XML I deal with:
>

Well, the point is that I have the .XSD, and what is specified in the
.XSD is a simple hierarchy like the one shown above, and therefore all
XML conforming to that .XSD should have that form.

J C



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent