IdentityXSL

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

IdentityXSL

cmarchand

 

 

Hello,

 

with JAXP, I can get an identity XSL with TransformerFactory.newInstance().newTransformer().

How can I get the same XSL via s9api ?

 

Best regards,

Christophe


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: IdentityXSL

Michael Kay
1. Create a Destination of the appropriate kind, e.g. new SAXDestination(myContentHandler);

2. If the source is an XdmValue call processor.writeXdmValue(xdmValue, destination)

3. Otherwise:

3a. If you're starting with a SAXSource or StreamSource, you can build an XdmNode (which is an XdmValue) using processor.newDocumentBuilder().build(Source)

3b. If you want to bypass the process of building an XdmValue in memory, then it depends on what you actually want to do:

** converting a Stream Source to a SAX destination is usually called parsing, and is done by any SAX parser

** converting a SAX source to a stream destination is usually called serialization. I don't think this can be done using s9api interfaces alone, but you can do it by putting together a pipeline from the components below the s9api layer:

Serializer serializer = proc.newSerializer();
ReceivingContentHandler rch = new ReceivingContentHandler();
rch.setReceiver(serializer, proc.getUnderlyingConfiguration());
XMLReader reader = ...
reader.setContentHandler(rch);
reader.parse();

Michael Kay
Saxonica




On 25 Nov 2015, at 13:20, [hidden email] wrote:

 
 

Hello,

 

with JAXP, I can get an identity XSL with TransformerFactory.newInstance().newTransformer().

How can I get the same XSL via s9api ?

 

Best regards,

Christophe

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: IdentityXSL

cmarchand
Thanks a lot !
It's so easy...
;)

Best regards,
Christophe

Le 25/11/2015 16:35, Michael Kay a écrit :
1. Create a Destination of the appropriate kind, e.g. new SAXDestination(myContentHandler);

2. If the source is an XdmValue call processor.writeXdmValue(xdmValue, destination)

3. Otherwise:

3a. If you're starting with a SAXSource or StreamSource, you can build an XdmNode (which is an XdmValue) using processor.newDocumentBuilder().build(Source)

3b. If you want to bypass the process of building an XdmValue in memory, then it depends on what you actually want to do:

** converting a Stream Source to a SAX destination is usually called parsing, and is done by any SAX parser

** converting a SAX source to a stream destination is usually called serialization. I don't think this can be done using s9api interfaces alone, but you can do it by putting together a pipeline from the components below the s9api layer:

Serializer serializer = proc.newSerializer();
ReceivingContentHandler rch = new ReceivingContentHandler();
rch.setReceiver(serializer, proc.getUnderlyingConfiguration());
XMLReader reader = ...
reader.setContentHandler(rch);
reader.parse();

Michael Kay
Saxonica




On 25 Nov 2015, at 13:20, [hidden email] wrote:

 
 

Hello,

 

with JAXP, I can get an identity XSL with TransformerFactory.newInstance().newTransformer().

How can I get the same XSL via s9api ?

 

Best regards,

Christophe

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help



------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help