You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by MazZzta <ma...@gmail.com> on 2010/07/05 13:25:01 UTC

FOP - Initial SAX Parser setup

Hi all,

I am working on a transformation via XSLT from (x)HTML to PDF output.
I'm aware that there is a SAX parser working somewhere underlying, but
couldn't figure out where. The reason for accessing the parser is that
I need to set some properties and features before the parsing process
is launched, such as:

// Turn on validation
parser.setFeature("http://xml.org/sax/features/validation", true);
// Ensure namespace processing is on (the default)
parser.setFeature("http://xml.org/sax/features/namespaces", true);
//Ignore URI checking
...
(do not rely only on these snippets, they're just an example of what
I'm trying to do)

Where on the code can I do this? Is there any other way of doing this?
I'd really appreciate if someone could point me out on the right
direction.

[Either this question is common or it is completely absurd, I got no clue]

Thanks a lot.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP - Initial SAX Parser setup

Posted by MazZzta <ma...@gmail.com>.
Thanks Craig, that was really helpful, and sorry for misplacing this post.

Regards.

On Mon, Jul 5, 2010 at 2:45 PM, Craig Ringer
<cr...@postnewspapers.com.au> wrote:
> On 5/07/2010 7:25 PM, MazZzta wrote:
>>
>> Hi all,
>>
>> I am working on a transformation via XSLT from (x)HTML to PDF output.
>> I'm aware that there is a SAX parser working somewhere underlying, but
>> couldn't figure out where.
>
> If you're using code based on the examples from the documentation:
>
> http://xmlgraphics.apache.org/fop/0.95/embedding.html
>
> ... the SAX parser is being used via the XSLT engine.
>
> If you're passing a StreamSource, the XSLT engine will construct a suitable
> parser behind the scenes, giving you very little control over what parser is
> used and how. If you want more control, you should probably instantiate and
> pass your own SAXSource:
>
> http://java.sun.com/javase/6/docs/api/javax/xml/transform/sax/SAXSource.html
>
>> [Either this question is common or it is completely absurd, I got no clue]
>
> It's really about how to use the JAXP APIs in Java, not a question about
> fop. The mailing list guidelines do suggest that if your question involves
> XSLT you're asking in the wrong place, and suggest some better places to
> ask.
>
> Stack Overflow (stackoverflow.com) can be a good place to ask for help with
> this sort of thing, as can various Java web forums (if you can stand
> forums).
>
> --
> Craig Ringer
>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: FOP - Initial SAX Parser setup

Posted by Craig Ringer <cr...@postnewspapers.com.au>.
On 5/07/2010 7:25 PM, MazZzta wrote:
> Hi all,
>
> I am working on a transformation via XSLT from (x)HTML to PDF output.
> I'm aware that there is a SAX parser working somewhere underlying, but
> couldn't figure out where.

If you're using code based on the examples from the documentation:

http://xmlgraphics.apache.org/fop/0.95/embedding.html

... the SAX parser is being used via the XSLT engine.

If you're passing a StreamSource, the XSLT engine will construct a 
suitable parser behind the scenes, giving you very little control over 
what parser is used and how. If you want more control, you should 
probably instantiate and pass your own SAXSource:

http://java.sun.com/javase/6/docs/api/javax/xml/transform/sax/SAXSource.html

> [Either this question is common or it is completely absurd, I got no clue]

It's really about how to use the JAXP APIs in Java, not a question about 
fop. The mailing list guidelines do suggest that if your question 
involves XSLT you're asking in the wrong place, and suggest some better 
places to ask.

Stack Overflow (stackoverflow.com) can be a good place to ask for help 
with this sort of thing, as can various Java web forums (if you can 
stand forums).

--
Craig Ringer

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org