Re: [xsl] Javascript in Xsl using-Xalan-Problem

Subject: Re: [xsl] Javascript in Xsl using-Xalan-Problem
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Sat, 5 Jun 2004 13:29:33 -0600
Hi Barry,

Thanks for the clarification.  Your problem is pretty straight forward and 
in fact can be done fairly easily in XSLT 1.0.  But you are correct in your 
assumption that 2.0 would be a much more complete and straight forward 
solution.  If for no other reason (and there are plenty) the regex 
implementation in 2.0 gives you the much needed ability to do complex string 
matching that, while possible in 1.0, is more complex to implement than is 
worth the effort.

With that said the EXSLT (http://www.exslt.org/) extensions supports regex 
and several other string functions and are supported on several platforms 
including .NET.  You might find that this is just the solution you are 
looking for while the XSLT 2.0 processors (at this point Saxon 7.9.1 and 
Oracle are the only processors I know of that have support for any of the 
2.0 spec) develop there support for the as-of-yet to become recommended spec 
for 2.0.

If you are looking for a solution that is supported on as many processors as 
possible (which it doesn't sound like is an important criteria) then contact 
me directly and I will be more than happy to share some code with you. 
Otherwise, check out EXSLT for the regex+ string manipulation or go for the 
gusto and use 2.0 with Saxon 7.9.1 (which it sounds like you're probably 
already doing.)

Best of luck!

<M:D/>


----- Original Message ----- 
From: "Barry Lay" <blay@xxxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Saturday, June 05, 2004 1:09 PM
Subject: Re: [xsl] Javascript in Xsl using-Xalan-Problem


> David,
>
> Actually Deepak reposted the question I sent out about a month ago.  He
> seems to have the same problem I have.
>
> Here is what I am trying to do:
>
> I have a set of scripts for assisting development in a rather dynamic
> project.  I had the requirement to build linking code between different
> databases, some with physical ERwin models, some with logical models,
> some not modelled at all, and with the usual problem that the models
> tended to get out of date.  My main interest was being able to map
> logical and physical models within my code.
>
> An example of the problem would be to convert between
>
> PARENT_BIS_CODE
>
> and
>
> ParentBISCode
>
> in both directions.  Both end up being values of attributes of a
> "column" element in an intermediary XML file.  The first is the physical
> name of the column in the database and the second is the logical name
> used in the Java code.  The (JavaScript) code currently recognises that
> "BIS" is a an acroynym (in the banking business) and thus doesn't
> lower-case it.  There are a number of other business rules that are
> applied, along with the technical restriction that Oracle's column names
> can not be longer than 30 characters, requiring that the
> logical-to-physical mapping be creative in shortening the name if it is
> too long.
>
> It would appear that the XSLT 2.0 analyze-string function would help
> quite a bit with this and that may be the direction I will go.  I am
> sure that this is possible in XSLT 1.0 but it didn't seem like the right
> language for the job.
>
> Thanks,
> Barry
>
> M. David Peterson wrote:
>
> >Hi Barry,
> >
> >Wasn't the original question posted by Deepak? Are you and Deepak one in 
> >the
> >same or am I missing something here?
> >
> >Anyway, I've done a lot of work in string manipulation in XSL and would 
> >be
> >happy to share with you both code base and expertise if you find yourself 
> >in
> >such need.
> >
> >Best regards,
> >
> ><M:D/>
> >
> >
> >----- Original Message ----- 
> >From: "Barry Lay" <blay@xxxxxxxxxxxxxxxxxxx>
> >To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> >Sent: Saturday, June 05, 2004 12:25 PM
> >Subject: Re: [xsl] Javascript in Xsl using-Xalan-Problem
> >
> >
> >
> >
> > ...
> >
> >
> >
>
> --+------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
> 

Current Thread