Re: More than one XML-file?

2005-04-11 Thread Uwe Klosa
root meant to be an example. I should have written another word. I only
wanted to illustrate the differences between files with namespace and
without a namespace.

Uwe

[EMAIL PROTECTED] wrote:

>>
>>
>>
>
>  
>
>>Than you can access the elements with this XPATH: $lookup/root.
>>
>>
>
>That'll work if file.xml has a top-level element named root. The actual 
>root node of the result tree fragment contained in the $lookup variable is 
>just $lookup/
>
>A nit pick but it does sometimes matter.
>
>Jay Bryant
>Bryant Communication Services
>(presently consulting at Synergistic Solution Technologies)
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  
>
begin:vcard
fn:Uwe Klosa
n:Klosa;Uwe
org:Uppsala University;Electronic Publishing Centre
adr:;;;Uppsala;;75120;Sweden
email;internet:[EMAIL PROTECTED]
tel;work:+46 (0)18 471 7658
url:http://publications.uu.se/epcentre
version:2.1
end:vcard


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: More than one XML-file?

2005-04-11 Thread JBryant
> 

> Than you can access the elements with this XPATH: $lookup/root.

That'll work if file.xml has a top-level element named root. The actual 
root node of the result tree fragment contained in the $lookup variable is 
just $lookup/

A nit pick but it does sometimes matter.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XML Question

2005-04-11 Thread Simon Pepping
Hi,

The SAX parser does not output XML. It outputs character strings. When
you write the text back to an XML file, you have to do XML escaping
again. That is not difficult, only a few characters must be escaped as
specified in the rec, see section 4.6.

You will be easier off by using an XML serializer. The TRAX interface
provides one: present your data as a SAXSource by letting your app
send the SAX events and request a StreamResult with an identity
transformation.

Regards, Simon

On Mon, Apr 11, 2005 at 02:41:37PM -0400, Puppala, Kumar (LNG-DAY) wrote:
> Thanks for your input. I think you are right. I cannot do this configuring
> something on the SAXParser. Rather I need to have the table mapping between
> ISO Latin-1 char set to XML character entities. Doing this, I will convert &
> back to &#amp; when I output my xml file. I am trying to find such a mapping
> table but am not able to find it. Does anyone know where I can find it?
> 
> Thanks,
> Kumar Puppala
> 
> 
> -Original Message-
> From: Andreas L. Delmelle [mailto:[EMAIL PROTECTED] 
> Sent: Monday, April 11, 2005 2:15 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: RE: XML Question
> 
> > -Original Message-
> > From: Andreas L. Delmelle [mailto:[EMAIL PROTECTED]
> >
> 
> > The problem is not so much the implicit conversion by the parser,
> > but rather the fact that the C++ app doesn't seem to take into
> > account that its output should be in full compliance with
> > the XML Rec. It seems to be outputting 'plain text that looks
> > very much like XML', but it isn't XML.
> 
> Hmm.. Maybe this needs some more explanation:
> 
> You have '&' in your input that, when parsed and output as plain text,
> will yield a '&'. A compliant XML application --with XML as output--
> *ALWAYS* needs to yield '&'.
> 
> Since a SAXParser is 100% XML compliant --well, should be--, an '&' *MAY*
> only be output as is, *IF AND ONLY IF* it is:
> - used in an entity (as the first boundary char)
> - in a CDATA section
> 
> All other appearances of a loose '&' should lead to:
> - an error (input)
> - '&' (output)
> 
> I still don't think the SAXParser itself can be configured to do anything
> different...
> 
> HTH!
> 
> Greetz,
> 
> AD
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
Simon Pepping
home page: http://www.leverkruid.nl


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XML Question

2005-04-11 Thread J.Pietschmann
Puppala, Kumar (LNG-DAY) wrote:
Thanks for your input. I think you are right. I cannot do this configuring
something on the SAXParser. Rather I need to have the table mapping between
ISO Latin-1 char set to XML character entities. Doing this, I will convert &
back to &#amp; when I output my xml file. I am trying to find such a mapping
table but am not able to find it. Does anyone know where I can find it?
You can output any character in text nodes or attribute values as a
character reference &#N;, where N is the decimal Unicode number
of the character. Space would be  , an upper case latin A would be
A, an non-breakable space would be  . You can also use &#x;
where  is the hexadecimal Unicode number. The output wouldn't be
very readable and somewhat bloated though.
The rules of which character has to be escaped where are in the XML rec:
 http://www.w3.org/TR/REC-xml
As a rule of thumb, you are almost safe if you do the following
substitutions in text and attribute values:
 < (less than sign, or opening angle bracket) --> <
 > (greater than sign, or closing angle bracket) --> >
 & (ampersand) --> &
 ' (apostrophe, or single quote) --> '
 " (double quote) --> "
An alternative is to enclose all text in CDATA sections, but you should
watch out for a ]]> sequence, and this can't be done for attribute
values.
In all cases there are some special, somewhat twisted rules for CR and
LF, if you waht to get them through to the next consumer.
All in all: XML serialization is *not* as easy as commonly assumed. You
should definitely search for a serialization library, IIRC libxml2
should provide one.
J.Pietschmann
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: XML Question

2005-04-11 Thread Andreas L. Delmelle
> -Original Message-
> From: Puppala, Kumar (LNG-DAY) [mailto:[EMAIL PROTECTED]
>

Hi,

> Thanks for your input. I think you are right. I cannot do this configuring
> something on the SAXParser. Rather I need to have the table
> mapping between ISO Latin-1 char set to XML character entities.

> I am trying to find such a mapping table but am not able to find it.

Well, that's mainly because there are only --literally-- a handful
predefined entities:

'<' for '<'
'&' for '&'
'>' for '>'
'"' for '"'
''' for '''

Named entities for other characters have to be defined in a referenced DTD.

Another straightforward approach is to map them via their Unicode CP value,
for example: '
' for line-feed.
ISO-Latin-1 is a Unicode subset, so maps quite easily...

HTH!

Greetz,

AD


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: XML Question

2005-04-11 Thread Puppala, Kumar (LNG-DAY)
Thanks for your input. I think you are right. I cannot do this configuring
something on the SAXParser. Rather I need to have the table mapping between
ISO Latin-1 char set to XML character entities. Doing this, I will convert &
back to &#amp; when I output my xml file. I am trying to find such a mapping
table but am not able to find it. Does anyone know where I can find it?

Thanks,
Kumar Puppala


-Original Message-
From: Andreas L. Delmelle [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 11, 2005 2:15 PM
To: fop-users@xmlgraphics.apache.org
Subject: RE: XML Question

> -Original Message-
> From: Andreas L. Delmelle [mailto:[EMAIL PROTECTED]
>

> The problem is not so much the implicit conversion by the parser,
> but rather the fact that the C++ app doesn't seem to take into
> account that its output should be in full compliance with
> the XML Rec. It seems to be outputting 'plain text that looks
> very much like XML', but it isn't XML.

Hmm.. Maybe this needs some more explanation:

You have '&' in your input that, when parsed and output as plain text,
will yield a '&'. A compliant XML application --with XML as output--
*ALWAYS* needs to yield '&'.

Since a SAXParser is 100% XML compliant --well, should be--, an '&' *MAY*
only be output as is, *IF AND ONLY IF* it is:
- used in an entity (as the first boundary char)
- in a CDATA section

All other appearances of a loose '&' should lead to:
- an error (input)
- '&' (output)

I still don't think the SAXParser itself can be configured to do anything
different...

HTH!

Greetz,

AD


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: More than one XML-file?

2005-04-11 Thread Uwe Klosa
I ahve to agree with that. Our webpages at http://publications.uu.se are
builded dynamically from XSL and XML. Much of the contents is include
with something like



Than you can access the elements with this XPATH: $lookup/root.

Be careful with different namespaces. If the included file contains
namespace declarations you have to declare them in the master document
and the XPATH will change to $lookup/ns:root

/Uwe

[EMAIL PROTECTED] wrote:

>>I'm thinking in the direction of using the dynamic XML-stream as
>>principal input to the XSL Transformation, and use the document()
>>function to access the static XML with the questions...
>>
>>
>
>I would try to use the document function as few times as possible, so I'd 
>want whichever source has the most elements to be the input to the 
>transformation. You could also read the entire second document into a 
>variable, to have much faster access to it. That way, you'd hit the 
>document function just once. If you have a small amount of static content 
>and a large amount of dynamic content that must frequently read from the 
>static content, you should get substantial speed benefits from writing the 
>static content into a variable with just one call to the document() 
>function.
>
>Jay Bryant
>Bryant Communication Services
>(presently consulting at Synergistic Solution Technologies)
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: XML Question

2005-04-11 Thread Andreas L. Delmelle
> -Original Message-
> From: Andreas L. Delmelle [mailto:[EMAIL PROTECTED]
>

> The problem is not so much the implicit conversion by the parser,
> but rather the fact that the C++ app doesn't seem to take into
> account that its output should be in full compliance with
> the XML Rec. It seems to be outputting 'plain text that looks
> very much like XML', but it isn't XML.

Hmm.. Maybe this needs some more explanation:

You have '&' in your input that, when parsed and output as plain text,
will yield a '&'. A compliant XML application --with XML as output--
*ALWAYS* needs to yield '&'.

Since a SAXParser is 100% XML compliant --well, should be--, an '&' *MAY*
only be output as is, *IF AND ONLY IF* it is:
- used in an entity (as the first boundary char)
- in a CDATA section

All other appearances of a loose '&' should lead to:
- an error (input)
- '&' (output)

I still don't think the SAXParser itself can be configured to do anything
different...

HTH!

Greetz,

AD


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: XML Question

2005-04-11 Thread Andreas L. Delmelle
> -Original Message-
> From: Puppala, Kumar (LNG-DAY) [mailto:[EMAIL PROTECTED]

Hi,

> This question is not strictly FOP based but I guess someone
> here might be able to help me.
> I am using SAXParser to parse my xml file to a .fo file
> using a C++ application. The parser implicitly converts
> &#amp; to &.

So the output is no longer valid XML...
The problem is not so much the implicit conversion by the parser, but rather
the fact that the C++ app doesn't seem to take into account that its output
should be in full compliance with the XML Rec. It seems to be outputting
'plain text that looks very much like XML', but it isn't XML.

I'm not sure if this type of problem can be solved by configuring the SAX
Parser (?)


Greetz,

AD


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: More than one XML-file?

2005-04-11 Thread JBryant
> I'm thinking in the direction of using the dynamic XML-stream as
> principal input to the XSL Transformation, and use the document()
> function to access the static XML with the questions...

I would try to use the document function as few times as possible, so I'd 
want whichever source has the most elements to be the input to the 
transformation. You could also read the entire second document into a 
variable, to have much faster access to it. That way, you'd hit the 
document function just once. If you have a small amount of static content 
and a large amount of dynamic content that must frequently read from the 
static content, you should get substantial speed benefits from writing the 
static content into a variable with just one call to the document() 
function.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: More than one XML-file?

2005-04-11 Thread Andreas L. Delmelle
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Hi,

> The situation is that I have one static XML-file which
> I use for layout purposes (questions) and one dynamic
> XML-stream or file with tagged data values coming from
> a database (answers).
> I want to create a pdf file with questions and answers.
> I will try some of your suggestions.

Well, certainly seems like the type of situation that can be handled with
the document() function.
I'm thinking in the direction of using the dynamic XML-stream as principal
input to the XSL Transformation, and use the document() function to access
the static XML with the questions...

For example, to access the Questions-file you could create an XSLT variable
like:


If you need any more details, feel free to ask --maybe better off-list,
since pure XSLT is considered to be off topic here--, but in that case it
would be cool if you could provide at least a minimal version of the used
files...


Greetz,

AD


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



XML Question

2005-04-11 Thread Puppala, Kumar (LNG-DAY)








This question is not strictly FOP based
but I guess someone here might be able to help me. I am using SAXParser to
parse my xml file to a .fo file using a C++ application. The parser implicitly
converts &#amp; to &. Hence when I send the .fo file (containing &
in the data), FOP renderer throws an exception since it parses the document as
well and does not like & in the data. I don't want my SAXParser to do
these implicit conversions. Is there any option I can use to turn off this
conversion when I initialize my SAXParser?

 



Thanks,

Kumar Puppala 










RE: More than one XML-file?

2005-04-11 Thread Lars . Hagrot
The situation is that I have one static XML-file which I use for layout purposes (questions) and one dynamic XML-stream or file with tagged data values coming from a database (answers). I want to create a pdf file with questions and answers. I will try some of your suggestions. Thank You very much for answering. Regards/Lars Hagrot  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem with embedding external graphics

2005-04-11 Thread Hassan-Zadeh, Martin
Thank yoo for the answer.
Unfortunately is URL based authentication not possible in the current setup
( constraints I have no influence on).

I think I have to use local temp directories in order to include graphics.

Kind Regards

Martin

-Original Message-
From: J.Pietschmann [mailto:[EMAIL PROTECTED]
Sent: Freitag, 8. April 2005 22:02
To: fop-users@xmlgraphics.apache.org
Subject: Re: Problem with embedding external graphics


Hassan-Zadeh, Martin wrote:
> is it possible to embed FOP into a servlet  ( concrete struts action ) in
a
> way that the relative 
> url for fo:external-graophics is using the same session and user principal
> when access the URL.

Short answer: No.
You can use a HTTP URL as src in a fo:external-graphic. There is no way
to pass HTTP auth data or cookies to the code which retrieves the data.
Hacking this into the code *will* get messy. Dynamic data has to be
encoded as part of the URL, e.g. as URL parameters, while generating
the FO document. You can try to use host based access restrictions on
your local web server in order to avoid other security mechanisms.

J.Pietschmann

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: favorite tools for writing XSLT?

2005-04-11 Thread Rymasz Jacky
I was just wondering: 
Does XMLSpy or other IDE have an UML type kinda functionalities?
What I mean is is it possible to have a graphical view of what template is
call where, by what XSL stylesheet, etc..??
... really like UML for Java/C++.

Jack


-Message d'origine-
De : John Root [mailto:[EMAIL PROTECTED] 
Envoyé : samedi 9 avril 2005 20:06
À : fop-users@xmlgraphics.apache.org
Objet : Re: favorite tools for writing XSLT?

On 4/7/05 2:47 PM, "Mike Trotman" <[EMAIL PROTECTED]> wrote:

> The main benefit of XMLSpy / other IDEs is that they can unpbtrusively 
> present you with a list of the attributes and legal values for 
> whichever element you are creating which saves time when learning 
> XSLT.

'Saves time' being the operative phrase here. An IDE is not simply
beneficial for learning XSLT, it makes the XSL development process go much
faster with less need for the verbose user input required by XML/XSL. Don't
underestimate the value of the XSL debugging environment provided by XMLSpy.
It's first rate and, IMO, indispensable for professional XML/XSL
development. For schema developers, the 'generate documentation' function of
XMLSpy is a real plus.

In truth, I'm a Mac user at heart and a big fan of BBEdit. I've tried a lot
of other tools for XML dev too, but became sold on XMLSpy after using it for
a tricky Win dev project. It's well worth looking into and with a 30 day
free (fully functional) download demo there's no up front financial
commitment. 

John


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]