You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Jesper Møller <je...@selskabet.org> on 2010/04/02 00:24:49 UTC

Re: implement XPath 2.0 function for xalan

Hi Xalan-dev list

I'm one of the committers on PsychoPath XPath 2 engine and would like to offer my input where I can help if this is a viable way.

First off, I must confess that while I know XSLT pretty well, I've not studied Xalan-J in depth. However, from looking over the design document for Xalan-J version 2, I can spot three major obstacles in consuming PsychoPath from Xalan-J:

1) PsychoPath is not "streamy" yet
2) Type informations is not part of current interfaces.
3) How would the XLST-to-bytecode (XSLTC) fit in?

Ad 1: This would have to come from PsychoPath itself, with inspiration from the Xerces-J XPath engine. Work has not been underway yet, which leads to point 2:
Ad 2: The DOM, NodeIterator and Schema interfaces aren't rich enough for the type information we need in XPath 2 (and thus XSLT 2).
Ad 3: I've tried a proof-of-concept of making a compiler in PsychoPath, but this is not under development at the moment. Can the compiler fall-back to the interpreted implementation?

On top of this, there is interest (from within the PsychoPath project itself) to clean up the API quite a bit. The current way we deal with static and dynamic context is just not well thought out. It's not a big issue, but in the interest of embeddability of the XPath2 enigne itself, the notion of dynamic and static context needs to be cleaned.

Other than that, I would think that merging the two projects is not required at all, Xalan-J should be able to simply consume PsychoPath once we have a decent API which can satisfy the requirements of both Xalan and Xerces. If not, I thing it would signify a design fault in our API.

Let's discuss (I've joined this mailing list for this reason)!

-Jesper


> 
> -------- Original Message --------
> Subject:	Re: Re: implement XPath 2.0 function for xalan
> Date:	Sun, 28 Mar 2010 08:39:20 +0800
> From:	ustbcoder <us...@gmail.com>
> Reply-To:	xalan-dev@xml.apache.org
> To:	xalan-dev@xml.apache.org <xa...@xml.apache.org>, xalan-dev@xml.apache.org <xa...@xml.apache.org>
> 
> 
> Hi
>  
> Yeah, i have checked out PsychoPath source code,i think it is a good idea to merge PsychoPath with Xalan, it will support nearly all the XPath 2.0 implemention for Xalan. After that, my task is to implement the other XSLT 2.0 specification for Xalan,this solution really speed this project up much.
>  
>  
> Gui Xun Long
>  
>  
> 2010-03-28
> ustbcoder
> 发件人: David Carver
> 发送时间: 2010-03-27  12:42:41
> 收件人: xalan-dev@xml.apache.org
> 抄送:
> 主题: Re: implement XPath 2.0 function for xalan
> You guys may be able to speed some of this up by leveraging the PsychoPath XPath 2.0 processor that is at Eclipse.
> 
> It is already being used by Xerces-J for XSD 1.1 Assertion support.   Why re-invent the wheel if you can leverage something that already exists.
> 
> http://wiki.eclipse.org/PsychoPathXPathProcessor
> 
> PsychoPath already is XML Schema Aware, leverages Xerces-J 2 and passes about 99.9% of the Xpath 2.0 test suite.
> 
> Dave
> 
> On 03/26/2010 09:25 PM, ustbcoder wrote:
>> 
>> Hi Michael,
>>  
>> Starting with utility parts is regular way to implement a new recommendation specification. But i think, functions is a very  practical part. If i finish it first,may be some guys can go it into service. Months ago,i was working with a XSLT project based on Xalan, i need some XPath 2.0 functions,but i have to finished them by Xalan extension mechanism one by one, it is a boring work, so ,i think, if some one implements these XPath 2.0 functions already, how beautiful the world is!
>>  
>> But i want to say that implementing functions is just a pre-handler job for Xalan's XSLT 2.0 implemention job, it must be done sooner or later, so i have started it,it won't go wrong. Then start with which parts,schema change,sequences change or some utility parts, i am not very sure, so,i need your help,all of you can give me some advises.
>>  
>>  
>> 2010-03-27
>> ustbcoder
>> 发件人: Michael Ludwig
>> 发送时间: 2010-03-27  04:39:44 
>> 收件人: xalan-j-users@xml.apache.org
>> 抄送:
>> 主题: Re: Re: implement XPath 2.0 function for xalan
>> xunlong gui schrieb am 26.03.2010 um 23:27:15 (+0800):
>> > 1.implements all the XSLT 2.0 functions which do not need sequences
>> > and XSLT 2.0 schema support
>> Leaving aside (W3C XML) schema awareness, the new type system of XPath
>> 2.0 seems the most fundamental change from 1.0 to 2.0, so I wonder
>> whether focussing on the utility parts would be a good start for any
>> effort to go to 2.0?
>> -- 
>> Michael Ludwig
> 
> 


Re: implement XPath 2.0 function for xalan

Posted by xunlong gui <us...@gmail.com>.
Hi Jesper,

Welcome here first!

As you said, one day if PsychoPath supplies a decent API which can satisfy
the requirement of both Xalan and Xerces, it will be very easy for Xalan to
consume PsychoPath.

But as you know, Xalan is known as a XSLT engine, support XSLT 2.0 is very
important,necessary and urgent  for it. Before the days PsychoPath supplies
a easy-to-use API for Xalan, i think implement XSLT 2.0 support for Xalan by
merging PsychoPath first, and then add some other features is not a bad
choice, for Xalan, just do it is not a bad thing. Once you guys offer a
decent API for Xalan, we can change our codes to fit new PsychoPath API.

You pointed out some limitations about the merging job, they are really
problems. My project aims to implement XSLT 2.0 for Xalan, merging
PsychoPath will speed up this project, but i do not extravagant claim that
PsychoPath can do everything for Xalan. So, i think,nowadays,merging
PsychoPath may be the fastest and best way for Xalan to support XSLT 2.0, if
i want to do this job well, i guess help from you guys will be very
necessary.

your opinion?

Xunlong Gui

>
>
> Other than that, I would think that merging the two projects is not
> required at all, Xalan-J should be able to simply consume PsychoPath once we
> have a decent API which can satisfy the requirements of both Xalan and
> Xerces. If not, I thing it would signify a design fault in our API.
>
> Let's discuss (I've joined this mailing list for this reason)!
>
> -Jesper
>

Re: implement XPath 2.0 function for xalan

Posted by David Carver <d_...@yahoo.com>.
On 04/12/2010 03:25 AM, Henry Zongaro wrote:
>
> Hi, David.
>
> Thanks for your responses.  I just had one point on which I wanted to 
> get clarification.  I asked:
>
> > 1. What is the form of the input accepted by PsychoPath?  Is it
> > restricted to taking a DOM (Level 2?) input tree - whose nodes might
> > implement the ItemPSVI interface of the Xerces XML Schema API?
>
> and you reponded:
>
> David Carver <d_...@yahoo.com> wrote on 04/11/2010 09:48:22 AM:
> > For XML Schema Awarness which PsychoPath supports, it requires
> > Xerces-J.  For all other DOM's that are given to it, it defaults to
> > just the XPath core functionality.   It currently requires a DOM
> > Level 3 implementation, which the vast majority of DOM's out there
> > now support.
>
> So does that mean input must always be in the form of a DOM tree?
As of right now, yes, it processes a DOM tree.  I've run it against, 
both the Xerces-J DOM which is it's reference it uses for tests, and the 
eclipse WTP DOM.   Both seem to work.   If given another DOM, I would 
expect it to work as well.

However, would love to get some resources working on bringing in other 
structures and working with them.   As Jesper said currently we don't do 
a SAX or StaX based walk through.  However, we haven't seen any problems 
with performance yet, with the DOM structure we are using.

One thing to note about PsychoPath's history is that it originally 
started out as a College research project, and sat on Sourceforge for 
about 4 or 5 years.   It's primary goal was to first and foremost 
provide an open-source XPath Schema Aware engine.   I talked to the 
original authors and manage to bring it over to eclipse.  We spent the 
last 6 to 8 months just bringing it up to compliance with the changes 
that occured from those early drafts and the current W3C Test Suite.

So we are at a point where we are about 99.9% compliant with the 
specification, now it's time to look at enhancing and allowing the 
engine to read and accept different inputs.

Again, patches and enhancements would be welcome to support other input 
mechanisms.

Dave


Re: implement XPath 2.0 function for xalan

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, David.

Thanks for your responses.  I just had one point on which I wanted to get 
clarification.  I asked:

> 1. What is the form of the input accepted by PsychoPath?  Is it 
> restricted to taking a DOM (Level 2?) input tree - whose nodes might
> implement the ItemPSVI interface of the Xerces XML Schema API? 

and you reponded:

David Carver <d_...@yahoo.com> wrote on 04/11/2010 09:48:22 AM:
> For XML Schema Awarness which PsychoPath supports, it requires 
> Xerces-J.  For all other DOM's that are given to it, it defaults to 
> just the XPath core functionality.   It currently requires a DOM 
> Level 3 implementation, which the vast majority of DOM's out there 
> now support.

So does that mean input must always be in the form of a DOM tree?

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro
XML Transformation & Query Development
IBM Canada Lab   T/L 313-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com


Re: implement XPath 2.0 function for xalan

Posted by David Carver <d_...@yahoo.com>.
Answers in line.

> Thanks for your thoughts.  I've spent a few minutes looking at some of 
> the PsychoPath documentation, and I have a few questions and comments:
>
> 1. What is the form of the input accepted by PsychoPath?  Is it 
> restricted to taking a DOM (Level 2?) input tree - whose nodes might 
> implement the ItemPSVI interface of the Xerces XML Schema API?
For XML Schema Awarness which PsychoPath supports, it requires 
Xerces-J.  For all other DOM's that are given to it, it defaults to just 
the XPath core functionality.   It currently requires a DOM Level 3 
implementation, which the vast majority of DOM's out there now support.


>
> 2. Does PsychoPath expose its abstract syntax tree representation of 
> XPath expressions?  I ask this because patterns in XSLT pose a special 
> problem.  A pattern like a/b/c is most conveniently evaluated as 
> self::c[parent::b/parent::a] - and making that kind of transformation 
> is most conveniently performed on the abstract syntax tree 
> representation of the expression.  So in order for Xalan-J to use 
> PsychoPath to perform XPath evaluation efficiently, it would probably 
> need to have access to the abstract syntax tree representation.  That 
> entails a higher degree of coupling than I think would be possible by 
> having Xalan-J simply using the PsychoPath user API.

Yes, the tree is exposed, but probably not in an ideal way.   Patches 
and contributions are always appreciated.  You can always use the 
internal API, but we are looking at making a true API next year, so 
input would be greatly appreciated...along with patches and unit tests. :)


>
> Similarly for XSLTC, though having the XSLT Java byte code generation 
> rely on PsychoPath to perform the XPath byte code generation would 
> certainly be possible, I think there would be a need to have 
> PsychoPath expose very specialized interfaces for byte code generation 
> that no casual user would be interested in.
File a bug report or enhancement request with the particular 
requirements and we can look at adding them.


>
>
> 3. Does PsychoPath expose facilities for plugging in user-defined 
> functions?  Such a facility would be needed to allow an XSLT processor 
> to define stylesheet functions that could be used within XPath 
> expressions.  Then of course there are other functions in XSLT that 
> could be invoked from an XPath expression in a stylesheet, some of 
> which are affected by declarations in the stylesheet:  key, 
> format-number, etc.
Yes, you can create user defined functions.  Psychopath uses the same 
library and API for defining all the XPath functions.  Adopters can 
extend the functionality through the same API that psychopath uses itself.

I would encourage anybody that thinks we are missing something in 
PsychioPath to file an enhancement request or bug.  We are currently in 
a API freeze right now, but will be starting up development on the next 
version of PyschoPath in July, so now is a great time to get in 
enhancement requests and feature requests.

Dave


Re: implement XPath 2.0 function for xalan

Posted by xunlong gui <us...@gmail.com>.
It is embarrassed that i mix you with David Bertoni, sorry :-(

2010/4/11 David Carver <d_...@yahoo.com>

>  Actually, I'm involved with the PsychoPath component at eclipse.
>
> Dave
>
>
> On 04/11/2010 07:27 AM, ustbcoder wrote:
>
> Hi David,
>
> Initially, i am interested in implementing XSLT 2.0 for Xalan, then, i
> discovered that merge with Xalan with PsychoPath will speed up this project.
> You said "The Xerces-J 2.10 upcoming release using PsychoPath as one of it's
> XPath 2.0 engines" , it seems that implement XSLT 2.0 for Xalan is in plan
> now, good to hear that, so many guys are eager to see that come true,I am
> eager to do something for this huge project. In fact, i hold "implement XSLT
> 2.0 for Xalan" as a GSoC 2010 project (you can find my proposal in attach
> file [1]), and Henry Zongaro agree with me and promise to mentor me, as we
> know, you are chairman of Apache Xalan community, if you can give me some
> advises or support on GSoC website, it will help me a lot and help our
> project win in GSoC proposal filter period, then i will have more then two
> months to finish the project with all my strength. Expecting to work with
> you guys longtimer Xalan developer, if you have time, give me some hands,
> thank you :-)
>
> [1] Project proposal "Implement XSLT 2.0 for Xalan"
>
> Best regards
>
> Xunlong Gui
>
> 2010-04-11
>  ------------------------------
> ustbcoder
> ------------------------------
> *发件人:* David Carver
> *发送时间:* 2010-04-11  21:40:21
> *收件人:* ustbcoder
> *抄送:* xalan-dev@xml.apache.org
> *主题:* Re: implement XPath 2.0 function for xalan
>  If there is not functionality you need, then I would HIGHLY recommend
> contributing patches back to the psychopath project.  The Xerces-J 2.10
> upcoming release using PsychoPath as one of it's XPath 2.0 engines, so it
> can be intergrated with out having to fork the code necessarily.
>
> If you don't see something you need, please consider contributing a patch
> at:
>
> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=WTP%20Source%20Editing
>
> File the enhancement/patch under the wst.xsl component where PsychoPath is
> maintained.
>
> I'm also the lead on the wst.xsl component, and will make sure that any
> patches are given attention.
>
> Dave
>
> On 04/11/2010 06:17 AM, ustbcoder wrote:
>
>  Hi Henry,
>
> These days, i was looking at PsychoPath document and source code and
> studing it, apparently, PsychoPath does not support enough user interface
> for Xalan to get all the necessary things such as get XPath syntax tree. But
> merging Xalan and PsychoPath and use PsychoPath as our  org.apache.xpath
> package replacing solution for Xalan is  feasible, in fact, i have done some
> experiment merging job :-)
>
> Regards
> Xunlong Gui
>
> 2010-04-11
>  ------------------------------
>  ustbcoder
> ------------------------------
> *发件人:* Henry Zongaro
> *发送时间:* 2010-04-11  20:47:00
> *收件人:* xalan-dev@xml.apache.org
> *抄送:* David Carver
> *主题:* Re: implement XPath 2.0 function for xalan
>
> Hi, Jesper.
>
> Jesper Møller <je...@selskabet.org> <je...@selskabet.org> wrote on
> 04/01/2010 06:24:49 PM:
> > I'm one of the committers on PsychoPath XPath 2 engine and would
> > like to offer my input where I can help if this is a viable way.
> >
> > First off, I must confess that while I know XSLT pretty well, I've
> > not studied Xalan-J in depth. However, from looking over the design
> > document for Xalan-J version 2, I can spot three major obstacles in
> > consuming PsychoPath from Xalan-J:
> >
> > 1) PsychoPath is not "streamy" yet
> > 2) Type informations is not part of current interfaces.
> > 3) How would the XLST-to-bytecode (XSLTC) fit in?
> >
> > Ad 1: This would have to come from PsychoPath itself, with
> > inspiration from the Xerces-J XPath engine. Work has not been
> > underway yet, which leads to point 2:
> > Ad 2: The DOM, NodeIterator and Schema interfaces aren't rich enough
> > for the type information we need in XPath 2 (and thus XSLT 2).
> > Ad 3: I've tried a proof-of-concept of making a compiler in
> > PsychoPath, but this is not under development at the moment. Can the
> > compiler fall-back to the interpreted implementation?
> >
> > On top of this, there is interest (from within the PsychoPath
> > project itself) to clean up the API quite a bit. The current way we
> > deal with static and dynamic context is just not well thought out.
> > It's not a big issue, but in the interest of embeddability of the
> > XPath2 enigne itself, the notion of dynamic and static context needs
> > to be cleaned.
> >
> > Other than that, I would think that merging the two projects is not
> > required at all, Xalan-J should be able to simply consume PsychoPath
> > once we have a decent API which can satisfy the requirements of both
> > Xalan and Xerces. If not, I thing it would signify a design fault in our
> API.
>
> Thanks for your thoughts.  I've spent a few minutes looking at some of the
> PsychoPath documentation, and I have a few questions and comments:
>
> 1. What is the form of the input accepted by PsychoPath?  Is it restricted
> to taking a DOM (Level 2?) input tree - whose nodes might implement the
> ItemPSVI interface of the Xerces XML Schema API?
>
> 2. Does PsychoPath expose its abstract syntax tree representation of XPath
> expressions?  I ask this because patterns in XSLT pose a special problem.  A
> pattern like a/b/c is most conveniently evaluated as
> self::c[parent::b/parent::a] - and making that kind of transformation is
> most conveniently performed on the abstract syntax tree representation of
> the expression.  So in order for Xalan-J to use PsychoPath to perform XPath
> evaluation efficiently, it would probably need to have access to the
> abstract syntax tree representation.  That entails a higher degree of
> coupling than I think would be possible by having Xalan-J simply using the
> PsychoPath user API.
>
> Similarly for XSLTC, though having the XSLT Java byte code generation rely
> on PsychoPath to perform the XPath byte code generation would certainly be
> possible, I think there would be a need to have PsychoPath expose very
> specialized interfaces for byte code generation that no casual user would be
> interested in.
>
> 3. Does PsychoPath expose facilities for plugging in user-defined
> functions?  Such a facility would be needed to allow an XSLT processor to
> define stylesheet functions that could be used within XPath expressions.
>  Then of course there are other functions in XSLT that could be invoked from
> an XPath expression in a stylesheet, some of which are affected by
> declarations in the stylesheet:  key, format-number, etc.
>
> Thanks,
>
> Henry
> ------------------------------------------------------------------
> Henry Zongaro
> XML Transformation & Query Development
> IBM Canada Lab   T/L 313-6044;  Phone +1 905 413-6044
> mailto:zongaro@ca.ibm.com <zo...@ca.ibm.com>
>
>
>
>

Re: implement XPath 2.0 function for xalan

Posted by David Carver <d_...@yahoo.com>.
Actually, I'm involved with the PsychoPath component at eclipse.

Dave

On 04/11/2010 07:27 AM, ustbcoder wrote:
> Hi David,
> Initially, i am interested in implementing XSLT 2.0 for Xalan, then, i 
> discovered that merge with Xalan with PsychoPath will speed up this 
> project. You said "The Xerces-J 2.10 upcoming release using PsychoPath 
> as one of it's XPath 2.0 engines" , it seems that implement XSLT 2.0 
> for Xalan is in plan now, good to hear that, so many guys are eager to 
> see that come true,I am eager to do something for this huge 
> project. In fact, i hold "implement XSLT 2.0 for Xalan" as a GSoC 2010 
> project (you can find my proposal in attach file [1]), and Henry 
> Zongaro agree with me and promise to mentor me, as we know, you are 
> chairman of Apache Xalan community, if you can give me some advises or 
> support on GSoC website, it will help me a lot and help our project 
> win in GSoC proposal filter period, then i will have more then two 
> months to finish the project with all my strength. Expecting to work 
> with you guys longtimer Xalan developer, if you have time, give me 
> some hands, thank you :-)
> [1] Project proposal "Implement XSLT 2.0 for Xalan"
> Best regards
> Xunlong Gui
> 2010-04-11
> ------------------------------------------------------------------------
> ustbcoder
> ------------------------------------------------------------------------
> *发件人:* David Carver
> *发送时间:* 2010-04-11  21:40:21
> *收件人:* ustbcoder
> *抄送:* xalan-dev@xml.apache.org
> *主题:* Re: implement XPath 2.0 function for xalan
> If there is not functionality you need, then I would HIGHLY recommend 
> contributing patches back to the psychopath project.  The Xerces-J 
> 2.10 upcoming release using PsychoPath as one of it's XPath 2.0 
> engines, so it can be intergrated with out having to fork the code 
> necessarily.
>
> If you don't see something you need, please consider contributing a 
> patch at:
>
> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=WTP%20Source%20Editing
>
> File the enhancement/patch under the wst.xsl component where 
> PsychoPath is maintained.
>
> I'm also the lead on the wst.xsl component, and will make sure that 
> any patches are given attention.
>
> Dave
>
> On 04/11/2010 06:17 AM, ustbcoder wrote:
>> Hi Henry,
>> These days, i was looking at PsychoPath document and source code and 
>> studing it, apparently, PsychoPath does not support enough 
>> user interface for Xalan to get all the necessary things such as get 
>> XPath syntax tree. But merging Xalan and PsychoPath and use 
>> PsychoPath as our  org.apache.xpath package replacing solution for 
>> Xalan is  feasible, in fact, i have done some experiment merging job :-)
>> Regards
>> Xunlong Gui
>> 2010-04-11
>> ------------------------------------------------------------------------
>> ustbcoder
>> ------------------------------------------------------------------------
>> *发件人:* Henry Zongaro
>> *发送时间:* 2010-04-11  20:47:00
>> *收件人:* xalan-dev@xml.apache.org
>> *抄送:* David Carver
>> *主题:* Re: implement XPath 2.0 function for xalan
>>
>> Hi, Jesper.
>>
>> Jesper Møller <je...@selskabet.org> wrote on 04/01/2010 06:24:49 PM:
>> > I'm one of the committers on PsychoPath XPath 2 engine and would
>> > like to offer my input where I can help if this is a viable way.
>> >
>> > First off, I must confess that while I know XSLT pretty well, I've
>> > not studied Xalan-J in depth. However, from looking over the design
>> > document for Xalan-J version 2, I can spot three major obstacles in
>> > consuming PsychoPath from Xalan-J:
>> >
>> > 1) PsychoPath is not "streamy" yet
>> > 2) Type informations is not part of current interfaces.
>> > 3) How would the XLST-to-bytecode (XSLTC) fit in?
>> >
>> > Ad 1: This would have to come from PsychoPath itself, with
>> > inspiration from the Xerces-J XPath engine. Work has not been
>> > underway yet, which leads to point 2:
>> > Ad 2: The DOM, NodeIterator and Schema interfaces aren't rich enough
>> > for the type information we need in XPath 2 (and thus XSLT 2).
>> > Ad 3: I've tried a proof-of-concept of making a compiler in
>> > PsychoPath, but this is not under development at the moment. Can the
>> > compiler fall-back to the interpreted implementation?
>> >
>> > On top of this, there is interest (from within the PsychoPath
>> > project itself) to clean up the API quite a bit. The current way we
>> > deal with static and dynamic context is just not well thought out.
>> > It's not a big issue, but in the interest of embeddability of the
>> > XPath2 enigne itself, the notion of dynamic and static context needs
>> > to be cleaned.
>> >
>> > Other than that, I would think that merging the two projects is not
>> > required at all, Xalan-J should be able to simply consume PsychoPath
>> > once we have a decent API which can satisfy the requirements of both
>> > Xalan and Xerces. If not, I thing it would signify a design fault 
>> in our API.
>>
>> Thanks for your thoughts.  I've spent a few minutes looking at some 
>> of the PsychoPath documentation, and I have a few questions and 
>> comments:
>>
>> 1. What is the form of the input accepted by PsychoPath?  Is it 
>> restricted to taking a DOM (Level 2?) input tree - whose nodes might 
>> implement the ItemPSVI interface of the Xerces XML Schema API?
>>
>> 2. Does PsychoPath expose its abstract syntax tree representation of 
>> XPath expressions?  I ask this because patterns in XSLT pose a 
>> special problem.  A pattern like a/b/c is most conveniently evaluated 
>> as self::c[parent::b/parent::a] - and making that kind of 
>> transformation is most conveniently performed on the abstract syntax 
>> tree representation of the expression.  So in order for Xalan-J to 
>> use PsychoPath to perform XPath evaluation efficiently, it would 
>> probably need to have access to the abstract syntax tree 
>> representation.  That entails a higher degree of coupling than I 
>> think would be possible by having Xalan-J simply using the PsychoPath 
>> user API.
>>
>> Similarly for XSLTC, though having the XSLT Java byte code generation 
>> rely on PsychoPath to perform the XPath byte code generation would 
>> certainly be possible, I think there would be a need to have 
>> PsychoPath expose very specialized interfaces for byte code 
>> generation that no casual user would be interested in.
>>
>> 3. Does PsychoPath expose facilities for plugging in user-defined 
>> functions?  Such a facility would be needed to allow an XSLT 
>> processor to define stylesheet functions that could be used within 
>> XPath expressions.  Then of course there are other functions in XSLT 
>> that could be invoked from an XPath expression in a stylesheet, some 
>> of which are affected by declarations in the stylesheet:  key, 
>> format-number, etc.
>>
>> Thanks,
>>
>> Henry
>> ------------------------------------------------------------------
>> Henry Zongaro
>> XML Transformation & Query Development
>> IBM Canada Lab   T/L 313-6044;  Phone +1 905 413-6044
>> mailto:zongaro@ca.ibm.com
>


Re: Re: implement XPath 2.0 function for xalan

Posted by ustbcoder <us...@gmail.com>.
Hi David,

Initially, i am interested in implementing XSLT 2.0 for Xalan, then, i discovered that merge with Xalan with PsychoPath will speed up this project. You said "The Xerces-J 2.10 upcoming release using PsychoPath as one of it's XPath 2.0 engines" , it seems that implement XSLT 2.0 for Xalan is in plan now, good to hear that, so many guys are eager to see that come true,I am eager to do something for this huge project. In fact, i hold "implement XSLT 2.0 for Xalan" as a GSoC 2010 project (you can find my proposal in attach file [1]), and Henry Zongaro agree with me and promise to mentor me, as we know, you are chairman of Apache Xalan community, if you can give me some advises or support on GSoC website, it will help me a lot and help our project win in GSoC proposal filter period, then i will have more then two months to finish the project with all my strength. Expecting to work with you guys longtimer Xalan developer, if you have time, give me some hands, thank you :-)

[1] Project proposal "Implement XSLT 2.0 for Xalan" 

Best regards

Xunlong Gui

2010-04-11 



ustbcoder 



发件人: David Carver 
发送时间: 2010-04-11  21:40:21 
收件人: ustbcoder 
抄送: xalan-dev@xml.apache.org 
主题: Re: implement XPath 2.0 function for xalan 
 
If there is not functionality you need, then I would HIGHLY recommend contributing patches back to the psychopath project.  The Xerces-J 2.10 upcoming release using PsychoPath as one of it's XPath 2.0 engines, so it can be intergrated with out having to fork the code necessarily.

If you don't see something you need, please consider contributing a patch at:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=WTP%20Source%20Editing

File the enhancement/patch under the wst.xsl component where PsychoPath is maintained.

I'm also the lead on the wst.xsl component, and will make sure that any patches are given attention.

Dave

On 04/11/2010 06:17 AM, ustbcoder wrote: 
Hi Henry,

These days, i was looking at PsychoPath document and source code and studing it, apparently, PsychoPath does not support enough user interface for Xalan to get all the necessary things such as get XPath syntax tree. But merging Xalan and PsychoPath and use PsychoPath as our  org.apache.xpath package replacing solution for Xalan is  feasible, in fact, i have done some experiment merging job :-)

Regards 
Xunlong Gui

2010-04-11 



ustbcoder 



发件人: Henry Zongaro 
发送时间: 2010-04-11  20:47:00 
收件人: xalan-dev@xml.apache.org 
抄送: David Carver 
主题: Re: implement XPath 2.0 function for xalan 

Hi, Jesper. 

Jesper Møller <je...@selskabet.org> wrote on 04/01/2010 06:24:49 PM:
> I'm one of the committers on PsychoPath XPath 2 engine and would 
> like to offer my input where I can help if this is a viable way. 
> 
> First off, I must confess that while I know XSLT pretty well, I've 
> not studied Xalan-J in depth. However, from looking over the design 
> document for Xalan-J version 2, I can spot three major obstacles in 
> consuming PsychoPath from Xalan-J: 
> 
> 1) PsychoPath is not "streamy" yet 
> 2) Type informations is not part of current interfaces. 
> 3) How would the XLST-to-bytecode (XSLTC) fit in? 
> 
> Ad 1: This would have to come from PsychoPath itself, with 
> inspiration from the Xerces-J XPath engine. Work has not been 
> underway yet, which leads to point 2: 
> Ad 2: The DOM, NodeIterator and Schema interfaces aren't rich enough
> for the type information we need in XPath 2 (and thus XSLT 2). 
> Ad 3: I've tried a proof-of-concept of making a compiler in 
> PsychoPath, but this is not under development at the moment. Can the
> compiler fall-back to the interpreted implementation? 
> 
> On top of this, there is interest (from within the PsychoPath 
> project itself) to clean up the API quite a bit. The current way we 
> deal with static and dynamic context is just not well thought out. 
> It's not a big issue, but in the interest of embeddability of the 
> XPath2 enigne itself, the notion of dynamic and static context needs
> to be cleaned. 
> 
> Other than that, I would think that merging the two projects is not 
> required at all, Xalan-J should be able to simply consume PsychoPath
> once we have a decent API which can satisfy the requirements of both
> Xalan and Xerces. If not, I thing it would signify a design fault in our API. 

Thanks for your thoughts.  I've spent a few minutes looking at some of the PsychoPath documentation, and I have a few questions and comments: 

1. What is the form of the input accepted by PsychoPath?  Is it restricted to taking a DOM (Level 2?) input tree - whose nodes might implement the ItemPSVI interface of the Xerces XML Schema API? 

2. Does PsychoPath expose its abstract syntax tree representation of XPath expressions?  I ask this because patterns in XSLT pose a special problem.  A pattern like a/b/c is most conveniently evaluated as self::c[parent::b/parent::a] - and making that kind of transformation is most conveniently performed on the abstract syntax tree representation of the expression.  So in order for Xalan-J to use PsychoPath to perform XPath evaluation efficiently, it would probably need to have access to the abstract syntax tree representation.  That entails a higher degree of coupling than I think would be possible by having Xalan-J simply using the PsychoPath user API. 

Similarly for XSLTC, though having the XSLT Java byte code generation rely on PsychoPath to perform the XPath byte code generation would certainly be possible, I think there would be a need to have PsychoPath expose very specialized interfaces for byte code generation that no casual user would be interested in. 

3. Does PsychoPath expose facilities for plugging in user-defined functions?  Such a facility would be needed to allow an XSLT processor to define stylesheet functions that could be used within XPath expressions.  Then of course there are other functions in XSLT that could be invoked from an XPath expression in a stylesheet, some of which are affected by declarations in the stylesheet:  key, format-number, etc. 

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro
XML Transformation & Query Development
IBM Canada Lab   T/L 313-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com 

Re: implement XPath 2.0 function for xalan

Posted by David Carver <d_...@yahoo.com>.
If there is not functionality you need, then I would HIGHLY recommend 
contributing patches back to the psychopath project.  The Xerces-J 2.10 
upcoming release using PsychoPath as one of it's XPath 2.0 engines, so 
it can be intergrated with out having to fork the code necessarily.

If you don't see something you need, please consider contributing a 
patch at:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=WTP%20Source%20Editing

File the enhancement/patch under the wst.xsl component where PsychoPath 
is maintained.

I'm also the lead on the wst.xsl component, and will make sure that any 
patches are given attention.

Dave

On 04/11/2010 06:17 AM, ustbcoder wrote:
> Hi Henry,
> These days, i was looking at PsychoPath document and source code and 
> studing it, apparently, PsychoPath does not support enough 
> user interface for Xalan to get all the necessary things such as get 
> XPath syntax tree. But merging Xalan and PsychoPath and use PsychoPath 
> as our  org.apache.xpath package replacing solution for Xalan 
> is  feasible, in fact, i have done some experiment merging job :-)
> Regards
> Xunlong Gui
> 2010-04-11
> ------------------------------------------------------------------------
> ustbcoder
> ------------------------------------------------------------------------
> *发件人:* Henry Zongaro
> *发送时间:* 2010-04-11  20:47:00
> *收件人:* xalan-dev@xml.apache.org
> *抄送:* David Carver
> *主题:* Re: implement XPath 2.0 function for xalan
>
> Hi, Jesper.
>
> Jesper Møller <je...@selskabet.org> wrote on 04/01/2010 06:24:49 PM:
> > I'm one of the committers on PsychoPath XPath 2 engine and would
> > like to offer my input where I can help if this is a viable way.
> >
> > First off, I must confess that while I know XSLT pretty well, I've
> > not studied Xalan-J in depth. However, from looking over the design
> > document for Xalan-J version 2, I can spot three major obstacles in
> > consuming PsychoPath from Xalan-J:
> >
> > 1) PsychoPath is not "streamy" yet
> > 2) Type informations is not part of current interfaces.
> > 3) How would the XLST-to-bytecode (XSLTC) fit in?
> >
> > Ad 1: This would have to come from PsychoPath itself, with
> > inspiration from the Xerces-J XPath engine. Work has not been
> > underway yet, which leads to point 2:
> > Ad 2: The DOM, NodeIterator and Schema interfaces aren't rich enough
> > for the type information we need in XPath 2 (and thus XSLT 2).
> > Ad 3: I've tried a proof-of-concept of making a compiler in
> > PsychoPath, but this is not under development at the moment. Can the
> > compiler fall-back to the interpreted implementation?
> >
> > On top of this, there is interest (from within the PsychoPath
> > project itself) to clean up the API quite a bit. The current way we
> > deal with static and dynamic context is just not well thought out.
> > It's not a big issue, but in the interest of embeddability of the
> > XPath2 enigne itself, the notion of dynamic and static context needs
> > to be cleaned.
> >
> > Other than that, I would think that merging the two projects is not
> > required at all, Xalan-J should be able to simply consume PsychoPath
> > once we have a decent API which can satisfy the requirements of both
> > Xalan and Xerces. If not, I thing it would signify a design fault in 
> our API.
>
> Thanks for your thoughts.  I've spent a few minutes looking at some of 
> the PsychoPath documentation, and I have a few questions and comments:
>
> 1. What is the form of the input accepted by PsychoPath?  Is it 
> restricted to taking a DOM (Level 2?) input tree - whose nodes might 
> implement the ItemPSVI interface of the Xerces XML Schema API?
>
> 2. Does PsychoPath expose its abstract syntax tree representation of 
> XPath expressions?  I ask this because patterns in XSLT pose a special 
> problem.  A pattern like a/b/c is most conveniently evaluated as 
> self::c[parent::b/parent::a] - and making that kind of transformation 
> is most conveniently performed on the abstract syntax tree 
> representation of the expression.  So in order for Xalan-J to use 
> PsychoPath to perform XPath evaluation efficiently, it would probably 
> need to have access to the abstract syntax tree representation.  That 
> entails a higher degree of coupling than I think would be possible by 
> having Xalan-J simply using the PsychoPath user API.
>
> Similarly for XSLTC, though having the XSLT Java byte code generation 
> rely on PsychoPath to perform the XPath byte code generation would 
> certainly be possible, I think there would be a need to have 
> PsychoPath expose very specialized interfaces for byte code generation 
> that no casual user would be interested in.
>
> 3. Does PsychoPath expose facilities for plugging in user-defined 
> functions?  Such a facility would be needed to allow an XSLT processor 
> to define stylesheet functions that could be used within XPath 
> expressions.  Then of course there are other functions in XSLT that 
> could be invoked from an XPath expression in a stylesheet, some of 
> which are affected by declarations in the stylesheet:  key, 
> format-number, etc.
>
> Thanks,
>
> Henry
> ------------------------------------------------------------------
> Henry Zongaro
> XML Transformation & Query Development
> IBM Canada Lab   T/L 313-6044;  Phone +1 905 413-6044
> mailto:zongaro@ca.ibm.com


Re: Re: implement XPath 2.0 function for xalan

Posted by ustbcoder <us...@gmail.com>.
Hi Henry,

These days, i was looking at PsychoPath document and source code and studing it, apparently, PsychoPath does not support enough user interface for Xalan to get all the necessary things such as get XPath syntax tree. But merging Xalan and PsychoPath and use PsychoPath as our  org.apache.xpath package replacing solution for Xalan is  feasible, in fact, i have done some experiment merging job :-)

Regards 
Xunlong Gui

2010-04-11 



ustbcoder 



发件人: Henry Zongaro 
发送时间: 2010-04-11  20:47:00 
收件人: xalan-dev@xml.apache.org 
抄送: David Carver 
主题: Re: implement XPath 2.0 function for xalan 
 

Hi, Jesper. 

Jesper Møller <je...@selskabet.org> wrote on 04/01/2010 06:24:49 PM:
> I'm one of the committers on PsychoPath XPath 2 engine and would 
> like to offer my input where I can help if this is a viable way. 
> 
> First off, I must confess that while I know XSLT pretty well, I've 
> not studied Xalan-J in depth. However, from looking over the design 
> document for Xalan-J version 2, I can spot three major obstacles in 
> consuming PsychoPath from Xalan-J: 
> 
> 1) PsychoPath is not "streamy" yet 
> 2) Type informations is not part of current interfaces. 
> 3) How would the XLST-to-bytecode (XSLTC) fit in? 
> 
> Ad 1: This would have to come from PsychoPath itself, with 
> inspiration from the Xerces-J XPath engine. Work has not been 
> underway yet, which leads to point 2: 
> Ad 2: The DOM, NodeIterator and Schema interfaces aren't rich enough
> for the type information we need in XPath 2 (and thus XSLT 2). 
> Ad 3: I've tried a proof-of-concept of making a compiler in 
> PsychoPath, but this is not under development at the moment. Can the
> compiler fall-back to the interpreted implementation? 
> 
> On top of this, there is interest (from within the PsychoPath 
> project itself) to clean up the API quite a bit. The current way we 
> deal with static and dynamic context is just not well thought out. 
> It's not a big issue, but in the interest of embeddability of the 
> XPath2 enigne itself, the notion of dynamic and static context needs
> to be cleaned. 
> 
> Other than that, I would think that merging the two projects is not 
> required at all, Xalan-J should be able to simply consume PsychoPath
> once we have a decent API which can satisfy the requirements of both
> Xalan and Xerces. If not, I thing it would signify a design fault in our API. 

Thanks for your thoughts.  I've spent a few minutes looking at some of the PsychoPath documentation, and I have a few questions and comments: 

1. What is the form of the input accepted by PsychoPath?  Is it restricted to taking a DOM (Level 2?) input tree - whose nodes might implement the ItemPSVI interface of the Xerces XML Schema API? 

2. Does PsychoPath expose its abstract syntax tree representation of XPath expressions?  I ask this because patterns in XSLT pose a special problem.  A pattern like a/b/c is most conveniently evaluated as self::c[parent::b/parent::a] - and making that kind of transformation is most conveniently performed on the abstract syntax tree representation of the expression.  So in order for Xalan-J to use PsychoPath to perform XPath evaluation efficiently, it would probably need to have access to the abstract syntax tree representation.  That entails a higher degree of coupling than I think would be possible by having Xalan-J simply using the PsychoPath user API. 

Similarly for XSLTC, though having the XSLT Java byte code generation rely on PsychoPath to perform the XPath byte code generation would certainly be possible, I think there would be a need to have PsychoPath expose very specialized interfaces for byte code generation that no casual user would be interested in. 

3. Does PsychoPath expose facilities for plugging in user-defined functions?  Such a facility would be needed to allow an XSLT processor to define stylesheet functions that could be used within XPath expressions.  Then of course there are other functions in XSLT that could be invoked from an XPath expression in a stylesheet, some of which are affected by declarations in the stylesheet:  key, format-number, etc. 

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro
XML Transformation & Query Development
IBM Canada Lab   T/L 313-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com 

Re: implement XPath 2.0 function for xalan

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Jesper.

Jesper Møller <je...@selskabet.org> wrote on 04/01/2010 06:24:49 PM:
> I'm one of the committers on PsychoPath XPath 2 engine and would 
> like to offer my input where I can help if this is a viable way.
> 
> First off, I must confess that while I know XSLT pretty well, I've 
> not studied Xalan-J in depth. However, from looking over the design 
> document for Xalan-J version 2, I can spot three major obstacles in 
> consuming PsychoPath from Xalan-J:
> 
> 1) PsychoPath is not "streamy" yet
> 2) Type informations is not part of current interfaces.
> 3) How would the XLST-to-bytecode (XSLTC) fit in?
> 
> Ad 1: This would have to come from PsychoPath itself, with 
> inspiration from the Xerces-J XPath engine. Work has not been 
> underway yet, which leads to point 2:
> Ad 2: The DOM, NodeIterator and Schema interfaces aren't rich enough
> for the type information we need in XPath 2 (and thus XSLT 2).
> Ad 3: I've tried a proof-of-concept of making a compiler in 
> PsychoPath, but this is not under development at the moment. Can the
> compiler fall-back to the interpreted implementation?
> 
> On top of this, there is interest (from within the PsychoPath 
> project itself) to clean up the API quite a bit. The current way we 
> deal with static and dynamic context is just not well thought out. 
> It's not a big issue, but in the interest of embeddability of the 
> XPath2 enigne itself, the notion of dynamic and static context needs
> to be cleaned.
> 
> Other than that, I would think that merging the two projects is not 
> required at all, Xalan-J should be able to simply consume PsychoPath
> once we have a decent API which can satisfy the requirements of both
> Xalan and Xerces. If not, I thing it would signify a design fault in our 
API.

Thanks for your thoughts.  I've spent a few minutes looking at some of the 
PsychoPath documentation, and I have a few questions and comments:

1. What is the form of the input accepted by PsychoPath?  Is it restricted 
to taking a DOM (Level 2?) input tree - whose nodes might implement the 
ItemPSVI interface of the Xerces XML Schema API?

2. Does PsychoPath expose its abstract syntax tree representation of XPath 
expressions?  I ask this because patterns in XSLT pose a special problem. 
A pattern like a/b/c is most conveniently evaluated as 
self::c[parent::b/parent::a] - and making that kind of transformation is 
most conveniently performed on the abstract syntax tree representation of 
the expression.  So in order for Xalan-J to use PsychoPath to perform 
XPath evaluation efficiently, it would probably need to have access to the 
abstract syntax tree representation.  That entails a higher degree of 
coupling than I think would be possible by having Xalan-J simply using the 
PsychoPath user API.

Similarly for XSLTC, though having the XSLT Java byte code generation rely 
on PsychoPath to perform the XPath byte code generation would certainly be 
possible, I think there would be a need to have PsychoPath expose very 
specialized interfaces for byte code generation that no casual user would 
be interested in.

3. Does PsychoPath expose facilities for plugging in user-defined 
functions?  Such a facility would be needed to allow an XSLT processor to 
define stylesheet functions that could be used within XPath expressions. 
Then of course there are other functions in XSLT that could be invoked 
from an XPath expression in a stylesheet, some of which are affected by 
declarations in the stylesheet:  key, format-number, etc.

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro
XML Transformation & Query Development
IBM Canada Lab   T/L 313-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com

RE: problem in disable-output-escaping

Posted by dipesh <di...@erevmax.com>.
Hi keshlam,

Thanks for reply

 

I set the output as ASCII . AND  I give &#246;&#233;&#217;&#210 as input. I
want out as &#246;&#233;&#217;&#210, same as input, but XSLT convert this in
to respective char. That destroys my output XML.

 

 

Dipesh Garg

 

  _____  

From: keshlam@us.ibm.com [mailto:keshlam@us.ibm.com] 
Sent: Friday, April 02, 2010 11:08 PM
To: xalan-dev@xml.apache.org
Subject: Re: problem in disable-output-escaping

 

If you're outputting in UTF-8, it can express all of Unicode directly (as
two- or three-byte sequences if necessary), so Numeric Character References
generally won't be needed and won't be produced. 

If you set the output encoding to ASCII rather than UTF-8, any characters
over 127 will be escaped as Numeric Character References (since ASCII is a
seven-bit code). 

Other encodings will differ in what they can escape directly vs. what they
have to escape. 



______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
 -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish (
<http://www.ovff.org/pegasus/songs/threes-rev-11.html>
http://www.ovff.org/pegasus/songs/threes-rev-11.html) 

Jesper Møller <je...@selskabet.org> wrote on 04/02/2010 11:42:19 AM:

> From: 
> 
> Jesper Møller <je...@selskabet.org> 
> 
> To: 
> 
> "xalan-dev@xml.apache.org" <xa...@xml.apache.org> 
> 
> Cc: 
> 
> "<xa...@xml.apache.org>" <xa...@xml.apache.org> 
> 
> Date: 
> 
> 04/02/2010 11:46 AM 
> 
> Subject: 
> 
> Re: problem in disable-output-escaping 
> 
> Hi! 
> The entities &#246;&#233;&#217;&#210; are all read into their 
> internal Java char representation, and since the codepoints in 
> question would never be encoded as entities, there is no escaping to
disable. 
> 
> BTW: This kind of question is more suited for the 'users' mail list 
> 
> Hope this helps! 
> 
> -Jesper 
> 
> On 02/04/2010, at 07.44, "dipesh" <di...@erevmax.com> wrote:

> Hi All, 
>   
> I used XSLT for transforming one xml to another xml. 
>   
> Input XML contain some ISO 8859 value like 
>   
>                                     <Address Type='1'> 
>                                         <AddressLine></AddressLine> 
>                                         
> <CityName>&#246;&#233;&#217;&#210;</CityName>

>                                     </Address> 
>   
> I am using xslt which looks like this 
>   
>                   <?xml version="1.0" encoding="UTF-8"?> 
> <xsl:stylesheet version="1.0" xmlns:xsl="
<http://www.w3.org/1999/XSL/Transform> http://www.w3.org/1999/XSL/Transform
> " > 
> <Address> 
>                        <xsl:attribute name="Type" namespace=""> 
>                              <xsl:value-of select="string
> ($var32_ProfileInfo/ns0:Profile/ns0:Customer/ns0:Address/@Type)"/> 
>                        </xsl:attribute>                       
>                            <AddressLine> 
>                                <xsl:value-of select="string
> (ns0:Customer/ns0:Address/ns0:AddressLine)"/> 
>                            </AddressLine> 
>                            <xsl:text disable-output-escaping="no" 
> >"&#246;&#233;&#217;&#210;"</xsl:text> 
>                            <CityName> 
>                              <xsl:value-of  
>
select="$var32_ProfileInfo/ns0:Profile/ns0:Customer/ns0:Address/ns0:CityName
" 
> disable-output-escaping="yes"/> 
>                            </CityName> 
>                     </Address> 
>                   </xsl:stylesheet> 
>   
> Now I want that output xml shold be like this 
>   
>                   <Address Type='1'> 
>                                         <AddressLine></AddressLine> 
>                                          &#246;&#233;&#217;&#210; 
>                                         
> <CityName>&#246;&#233;&#217;&#210;</CityName>

>                                     </Address> 
>   
> But it gives output like this 
>   
>                                    <Address Type='1'> 
>                                         <AddressLine></AddressLine> 
>                                          öéÙÒ 
>                                         <CityName>öéÙÒ</CityName>

>                                     </Address> 
>   
>   
> Can anybody can tell me how I can solve this problem 
>   
> DISCLAIMER
> This email message and any accompanying attachments may contain 
> confidential information.
> If you are not the intended recipient, do not read, use, 
> disseminate, distribute or copy
> this message or attachments. If you have received this message in 
> error, please notify the
> sender immediately and delete this message. Any views expressed in 
> this message are those
> of the individual sender, except where the sender expressly, and 
> with authority, states
> them to be the views of eRevMax Technologies, Inc. Before opening 
> any attachments, please
> check them for viruses and defects.


DISCLAIMER
This email message and any accompanying attachments may contain confidential information.
If you are not the intended recipient, do not read, use, disseminate, distribute or copy 
this message or attachments. If you have received this message in error, please notify the
sender immediately and delete this message. Any views expressed in this message are those 
of the individual sender, except where the sender expressly, and with authority, states 
them to be the views of eRevMax Technologies, Inc. Before opening any attachments, please
check them for viruses and defects.

Re: problem in disable-output-escaping

Posted by ke...@us.ibm.com.
If you're outputting in UTF-8, it can express all of Unicode directly (as 
two- or three-byte sequences if necessary), so Numeric Character 
References generally won't be needed and won't be produced.

If you set the output encoding to ASCII rather than UTF-8, any characters 
over 127 will be escaped as Numeric Character References (since ASCII is a 
seven-bit code).

Other encodings will differ in what they can escape directly vs. what they 
have to escape.



______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish (
http://www.ovff.org/pegasus/songs/threes-rev-11.html)

Jesper Møller <je...@selskabet.org> wrote on 04/02/2010 11:42:19 AM:

> From:
> 
> Jesper Møller <je...@selskabet.org>
> 
> To:
> 
> "xalan-dev@xml.apache.org" <xa...@xml.apache.org>
> 
> Cc:
> 
> "<xa...@xml.apache.org>" <xa...@xml.apache.org>
> 
> Date:
> 
> 04/02/2010 11:46 AM
> 
> Subject:
> 
> Re: problem in disable-output-escaping
> 
> Hi!
> The entities &#246;&#233;&#217;&#210; are all read into their 
> internal Java char representation, and since the codepoints in 
> question would never be encoded as entities, there is no escaping to 
disable.
> 
> BTW: This kind of question is more suited for the 'users' mail list
> 
> Hope this helps!
> 
> -Jesper
> 
> On 02/04/2010, at 07.44, "dipesh" <di...@erevmax.com> wrote:

> Hi All,
> 
> I used XSLT for transforming one xml to another xml.
> 
> Input XML contain some ISO 8859 value like 
> 
>                                     <Address Type='1'>
>                                         <AddressLine></AddressLine>
> 
> <CityName>&#246;&#233;&#217;&#210;</CityName>  
>                                     </Address>
> 
> I am using xslt which looks like this 
> 
>                   <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform
> " >
> <Address>
>                        <xsl:attribute name="Type" namespace="">
>                              <xsl:value-of select="string
> ($var32_ProfileInfo/ns0:Profile/ns0:Customer/ns0:Address/@Type)"/>
>                        </xsl:attribute> 
>                            <AddressLine>
>                                <xsl:value-of select="string
> (ns0:Customer/ns0:Address/ns0:AddressLine)"/>
>                            </AddressLine>
>                            <xsl:text disable-output-escaping="no" 
> >"&#246;&#233;&#217;&#210;"</xsl:text>
>                            <CityName>
>                              <xsl:value-of 
> 
select="$var32_ProfileInfo/ns0:Profile/ns0:Customer/ns0:Address/ns0:CityName" 

> disable-output-escaping="yes"/>
>                            </CityName>
>                     </Address>
>                   </xsl:stylesheet>
> 
> Now I want that output xml shold be like this
> 
>                   <Address Type='1'>
>                                         <AddressLine></AddressLine>
>                                          &#246;&#233;&#217;&#210;
> 
> <CityName>&#246;&#233;&#217;&#210;</CityName>  
>                                     </Address>
> 
> But it gives output like this
> 
>                                    <Address Type='1'>
>                                         <AddressLine></AddressLine>
>                                          öéÙÒ
>                                         <CityName>öéÙÒ</CityName>  
>                                     </Address>
> 
> 
> Can anybody can tell me how I can solve this problem
> 
> DISCLAIMER
> This email message and any accompanying attachments may contain 
> confidential information.
> If you are not the intended recipient, do not read, use, 
> disseminate, distribute or copy
> this message or attachments. If you have received this message in 
> error, please notify the
> sender immediately and delete this message. Any views expressed in 
> this message are those
> of the individual sender, except where the sender expressly, and 
> with authority, states
> them to be the views of eRevMax Technologies, Inc. Before opening 
> any attachments, please
> check them for viruses and defects.

Re: problem in disable-output-escaping

Posted by Jesper Møller <je...@selskabet.org>.
Hi!
The entities &#246;&#233;&#217;&#210; are all read into their internal  
Java char representation, and since the codepoints in question would  
never be encoded as entities, there is no escaping to disable.

BTW: This kind of question is more suited for the 'users' mail list

Hope this helps!

-Jesper

On 02/04/2010, at 07.44, "dipesh" <di...@erevmax.com> wrote:

> Hi All,
>
> I used XSLT for transforming one xml to another xml.
>
> Input XML contain some ISO 8859 value like
>
>                                     <Address Type='1'>
>                                         <AddressLine></AddressLine>
>                                          
> <CityName>&#246;&#233;&#217;&#210;</CityName>
>                                     </Address>
>
> I am using xslt which looks like this
>
>                   <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform 
> " >
> <Address>
>                        <xsl:attribute name="Type" namespace="">
>                              <xsl:value-of select="string 
> ($var32_ProfileInfo/ns0:Profile/ns0:Customer/ns0:Address/@Type)"/>
>                        </xsl:attribute>
>                            <AddressLine>
>                                <xsl:value-of select="string 
> (ns0:Customer/ns0:Address/ns0:AddressLine)"/>
>                            </AddressLine>
>                            <xsl:text disable-output-escaping="no"  
> >"&#246;&#233;&#217;&#210;"</xsl:text>
>                            <CityName>
>                              <xsl:value-of   
> select="$var32_ProfileInfo/ns0:Profile/ns0:Customer/ns0:Address/ 
> ns0:CityName" disable-output-escaping="yes"/>
>                            </CityName>
>                     </Address>
>                   </xsl:stylesheet>
>
> Now I want that output xml shold be like this
>
>                   <Address Type='1'>
>                                         <AddressLine></AddressLine>
>                                          &#246;&#233;&#217;&#210;
>                                          
> <CityName>&#246;&#233;&#217;&#210;</CityName>
>                                     </Address>
>
> But it gives output like this
>
>                                    <Address Type='1'>
>                                         <AddressLine></AddressLine>
>                                          öéÙÒ
>                                         <CityName>öéÙÒ</CityName>
>                                     </Address>
>
>
> Can anybody can tell me how I can solve this problem
>
> DISCLAIMER
> This email message and any accompanying attachments may contain  
> confidential information.
> If you are not the intended recipient, do not read, use,  
> disseminate, distribute or copy
> this message or attachments. If you have received this message in  
> error, please notify the
> sender immediately and delete this message. Any views expressed in  
> this message are those
> of the individual sender, except where the sender expressly, and  
> with authority, states
> them to be the views of eRevMax Technologies, Inc. Before opening  
> any attachments, please
> check them for viruses and defects.

problem in disable-output-escaping

Posted by dipesh <di...@erevmax.com>.
Hi All,

 

I used XSLT for transforming one xml to another xml.

 

Input XML contain some ISO 8859 value like 

 

                                    <Address Type='1'>

                                        <AddressLine></AddressLine>

 
<CityName>&#246;&#233;&#217;&#210;</CityName>


                                    </Address>

 

I am using xslt which looks like this 

 

                  <?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

<Address>

                       <xsl:attribute name="Type" namespace="">

                             <xsl:value-of
select="string($var32_ProfileInfo/ns0:Profile/ns0:Customer/ns0:Address/@Type
)"/>

                       </xsl:attribute>                      

                           <AddressLine>

                               <xsl:value-of
select="string(ns0:Customer/ns0:Address/ns0:AddressLine)"/>

                           </AddressLine>

                           <xsl:text disable-output-escaping="no"
>"&#246;&#233;&#217;&#210;"</xsl:text>

                           <CityName>

                             <xsl:value-of
select="$var32_ProfileInfo/ns0:Profile/ns0:Customer/ns0:Address/ns0:CityName
" disable-output-escaping="yes"/>

                           </CityName>

                    </Address>

                  </xsl:stylesheet>

 

Now I want that output xml shold be like this

 

                  <Address Type='1'>

                                        <AddressLine></AddressLine>

                                         &#246;&#233;&#217;&#210;

 
<CityName>&#246;&#233;&#217;&#210;</CityName>


                                    </Address>

 

But it gives output like this

 

                                   <Address Type='1'>

                                        <AddressLine></AddressLine>

                                         öéÙÒ

                                        <CityName>öéÙÒ</CityName>


                                    </Address>

 

 

Can anybody can tell me how I can solve this problem

 


DISCLAIMER
This email message and any accompanying attachments may contain confidential information.
If you are not the intended recipient, do not read, use, disseminate, distribute or copy 
this message or attachments. If you have received this message in error, please notify the
sender immediately and delete this message. Any views expressed in this message are those 
of the individual sender, except where the sender expressly, and with authority, states 
them to be the views of eRevMax Technologies, Inc. Before opening any attachments, please
check them for viruses and defects.

Re: implement XPath 2.0 function for xalan

Posted by ke...@us.ibm.com.
> 1) PsychoPath is not "streamy" yet

Nor is Xalan, really. We have some ability to do deferred loading of the 
document, but real streaming is one of those "always wanted, never got 
around to" projects. It's a _big_ challenge.

> 2) Type informations is not part of current interfaces.

True. One would have to extend or replace the DTM interfaces to carry the 
additional data. There are a few sketches in the code suggesting possible 
ways to approach this, but again, we didn't have the resources to pursue 
them in the Xalan codebase.

> 3) How would the XLST-to-bytecode (XSLTC) fit in?

XSLTC runs against the same data model interfaces (DTM), and In Theory 
implementing compilation should just be a matter of generating code 
equivalent to what the interpreter is doing. In practice, it's a lot of 
detail work.


> Ad 2: The DOM, NodeIterator and Schema interfaces aren't rich enough
> for the type information we need in XPath 2 (and thus XSLT 2).

Xalan currently runs on the DTM interfaces and data model. Those could 
certainly be extended to carry schema information. Work would also have to 
be done to replace the nodeset representation with something that could 
handle general Sequences (intermixed nodes and atomic values, possibly 
with schema types in both cases). An alternative might be to replace the 
DTM layer with a different abstraction.

> Other than that, I would think that merging the two projects is not 
> required at all, Xalan-J should be able to simply consume PsychoPath

Making that efficient will require converging the document models, I 
think. There are good reasons for not using an Object-per-node model like 
the DOM; storage size becomes a problem (Java objects carry a lot of 
baggage). DTM was a first cut at reducing that overhead, and in tuning the 
data model design for the needs of XPath, XSLT, and high-speed 
serialization. More could be done, but if you want performance you really 
want everyone to be talking the same language at the API level; adapters 
can be expensive unless everything is designed VERY carefully up front.