OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Bad programmers use recursion, xslt (Offtopic...)

[ Lists Home | Date Index | Thread Index ]
  • To: Tatu Saloranta <cowtowncoder@yahoo.com>, xml-dev@lists.xml.org
  • Subject: Re: [xml-dev] Bad programmers use recursion, xslt (Offtopic...)
  • From: Michele Vivoda <idmichele@yahoo.it>
  • 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@web32810.mail.mud.yahoo.com>

 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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS