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

Re: Bad programmers use recursion, xslt (Offtopic...)

  • To: Tatu Saloranta <cowtowncoder@y...>, xml-dev@l...
  • Subject: Re: Bad programmers use recursion, xslt (Offtopic...)
  • From: Michele Vivoda <idmichele@y...>
  • Date: Tue, 28 Mar 2006 17:39:51 +0200 (CEST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.it; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=fq0G6VnRymRUyYDUNsLsjHlN6Ws4dKNgpAiQW8PHBt1zyZTkbfdaFa2bBUT8EaSq3SJKbburmDbS8BgQHXTf5EHjHYb3dpJEYgHmmhg1bTiPULy/aat489hJ/pjlHQEGsSucNldhumnSTfqBkmW8a72GAregVKIJYbp8FTF4C9s= ;
  • In-reply-to: <20060327205752.77149.qmail@w...>

when not to use recursion
 It is better (for the use case in
> hand... not necessarily generally) to first flatten
> style tree, then use flattened styles in the second
> transformation phase. 

I agree, I have experience in transforming w3c schema,
there is big difference between the xml format and 
the components expressed. Resolving the  components 
you MUST build some 'temporary tree' and is MUCH 
better to unify the cases 
that you can meet to a single case 
instead of handling them differently (for example 
complex types that are global or defined inline,
at least for the part of transformation that
is common). 

I needed to resolve qnames in attribute values
(otherwise I could get crazy I think), schemas
composition and then references resolution.

I am trying to transform as experiment, with
no optimization and partial results,
the DocBook w3c schema:

1 pass for each schema document for qnames 
1 pass for each composed document (with include e
import resolved, normalized and all present in the
source doc)
1 final pass for the result of 2nd pass for root
schema to get to the final result (with all the
normalized and resolved documents in a tree of
documents)

Still not sure if it might be enough 
for resolving 100% correctly the schema components 
from their definition, but it covers 
most of the spec examples, many real cases,
I had good results also with STAR schema, I am
still working on these xslt

Anway it takes 57 seconds for docbook, 
but as I said no optimization, a lot of code for 
error/warnings reporting. 

I think the schema files are around 400KB.
My stylesheets are 100 KB with large comments.

In this case performance is not an issue,
is more about managing complexity, I don't know
how I could have done without xslt.

An other thing is that what I am trying to do
is transforming the meaning of the w3c schema into
other semantics expressed in an other format.
Not just an other format for the same semantics,
so is more like a 'meaning + format transformation'
then a 'format/presentational transformation'.
 
In my case this aspect is particularly strong
since the structure of the models
expressed by the two formats
do not match in some basic points 
and some decisions must be taken. 
To make these decisions I have to 
fully resolve the schema!!

I think this applies also if one just
wants to create some documentation for the
schema or, more clearly, when one wants
to syntax check the schema in some meaningful way.

May be this might apply to some degree 
also to your use case, I don't know much
about open office and doc book, what you think ?

> Perhaps now is time to formalize
> them,
> as Michael pointed out?

For sure it would be a good initiative.
Michele


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


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.