Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Tool that generates xsl:template tags from xsd?

Reply
Thread Tools

Tool that generates xsl:template tags from xsd?

 
 
KJ
Guest
Posts: n/a
 
      05-27-2005
I would like to know if there is a tool for download or purchase that
will generate a skeleton xslt document, inserting all the
xsl:template's matching each element specified in any given xsd.

Does anyone know of one?

Thanks,
KJ

 
Reply With Quote
 
 
 
 
scooterm@hotmail.com
Guest
Posts: n/a
 
      05-27-2005
This sort of thing can be done relatively easily with any of the
various
scripting languages that have XML libraries (python, perl, ruby). All
of which can be downloaded and installed on every major OS out there,
usually with no license fee.

 
Reply With Quote
 
 
 
 
Soren Kuula
Guest
Posts: n/a
 
      05-27-2005
KJ wrote:

>I would like to know if there is a tool for download or purchase that
>will generate a skeleton xslt document, inserting all the
>xsl:template's matching each element specified in any given xsd.
>
>Does anyone know of one?
>
>Thanks,
>KJ
>
>
>

Tell me more about what you want to use it for please.

I am writing a collection of schema-aware tools for XSL right now. I
might want to include that if it's really practically useful for somebody.

BTW, with local elements: If you have two locally declared element types
named "foo", do you want a template for each of them then?

Soren
 
Reply With Quote
 
KJ
Guest
Posts: n/a
 
      05-27-2005
Well, here's the reason I asked. Since I'm in the habit of transforming
xml docs using the xsl:template paradigm (if it can be called that), it
would be nice if a program had a feature whereby I could provide the
program with any xsd, and the program would generate a xslt file with
(at least) an <xsl:template> for each element that would match all
instances of the xsd.

I tried Altova's StyleVision, which generates xslt from an xsd,
however, it relies heavily on the xsl:for-each "paradigm".

 
Reply With Quote
 
Malcolm Dew-Jones
Guest
Posts: n/a
 
      05-27-2005
KJ ((E-Mail Removed)) wrote:
: I would like to know if there is a tool for download or purchase that
: will generate a skeleton xslt document, inserting all the
: xsl:template's matching each element specified in any given xsd.

: Does anyone know of one?

No. But it doesn't sound difficult.

If you post a couple of simple xsd example files and the result you want,
then someone might give a few examples of how to do that based on those
examples.

(No promises.)

--

This space not for rent.
 
Reply With Quote
 
Soren Kuula
Guest
Posts: n/a
 
      05-27-2005
KJ wrote:

>Well, here's the reason I asked. Since I'm in the habit of transforming
>xml docs using the xsl:template paradigm (if it can be called that), it
>would be nice if a program had a feature whereby I could provide the
>program with any xsd, and the program would generate a xslt file with
>(at least) an <xsl:template> for each element that would match all
>instances of the xsd.
>
>I tried Altova's StyleVision, which generates xslt from an xsd,
>however, it relies heavily on the xsl:for-each "paradigm".
>
>

OK, so I take it is really mostly a matter of generating some empty code
skeletons...

Hey, you might actually make an xslt for that. There is some way (output
namespace aliasing or somthin', can't remember the details) to tell an
xsl processor "this (result tree fragment / sequence) is not an xsl
instruction for you, even though it's in the xsl namespace and really
looks like an xsl instruction". But of course xsd includes and imports
might be a bitch.

BTW, for-each can always be translated to template matching, unless on
the (pathological??) namespace axis. You can always do

<xsl:template match="pattern">
....
<xsl:for-each select="exp">
<t/>
</xsl:for-each>
....
</xsl:template>

to
<xsl:template match="pattern">
....
<xsl:apply-templates select="exp" mode="some_fresh_mode"/>
....
</xsl:template>

<xsl:template match="node()" mode="some_fresh_mode">
<t/>
</xsl:template>

(just FYI -- except for that namespace axis, there is nothing for-each
can do that templates can't do).

OK, I think it seems like a pretty simple task One could easily hack
up something to make that, have a go at it

Soren
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
documentation tool for XSLT which generates offline text formats Christian XML 2 04-02-2008 11:25 PM
XSLT generates values, but not tags wickedbomb XML 2 07-14-2005 02:20 PM
All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer Rob Nicholson ASP .Net 3 05-28-2005 03:11 PM
Open-source tool which generates Java Value objects ? writeOnceDebugEverywhere() Java 5 03-23-2005 07:24 PM
RegEx to find CFML tags nested in HTML tags Dean H. Saxe Perl 0 01-03-2004 06:11 PM



Advertisments