You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Tonny Kohar <to...@kiyut.com> on 2005/02/23 06:47:50 UTC
XMLSupport.defaultXMLSpace(String) questions
Hi,
I have a questions regarding the return value from
org.apache.batik.dom.util.XMLSupport.defaultXMLSpace(String).
Does the return value should be without trim ?
Thanks
Tonny Kohar
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: XMLSupport.defaultXMLSpace(String) questions
Posted by Thomas DeWeese <Th...@Kodak.com>.
Tonny Kohar wrote:
> Since Batik is also SVG processor, does the white-space processing
> returned by that method is valid?
What method? defaultXMLSpace? yes I believe so for the very simple
case of a single text node child (it wouldn't be right for tspans).
> eg:
> <text someAttr=".."> text with white-space before and after </text>
> that method trim() will remove the leading/trailing whitespace.
Trim alone is not enough for the "default" case as you also need to
collapse multiple spaces and remove CR/NL. Search the SVG specification
for xml:space for the actual text.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: XMLSupport.defaultXMLSpace(String) questions
Posted by Tonny Kohar <to...@kiyut.com>.
Hi,
> Sorry, I answered a completely different question.
>
> Since the XML 1.0 rec says
>
> The value "default" signals that applications' default white-space
> processing modes are acceptable for this element;
>
> I imagine that any behaviour wrt whitespace is valid.
Since Batik is also SVG processor, does the white-space processing
returned by that method is valid?
eg:
<text someAttr=".."> text with white-space before and after </text>
that method trim() will remove the leading/trailing whitespace.
Thanks
Tonny Kohar
--
Sketsa
SVG Graphics Editor
http://www.kiyut.com
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: XMLSupport.defaultXMLSpace(String) questions
Posted by Cameron McCormack <ca...@aka.mcc.id.au>.
Sorry, I answered a completely different question.
Since the XML 1.0 rec says
The value "default" signals that applications' default white-space
processing modes are acceptable for this element;
I imagine that any behaviour wrt whitespace is valid.
Cameron
--
e-mail : cam (at) mcc.id.au icq : 26955922
web : http://mcc.id.au/ msn : cam-msn (at) aka.mcc.id.au
office : +61399055779 jabber : heycam (at) jabber.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: XMLSupport.defaultXMLSpace(String) questions
Posted by Cameron McCormack <ca...@aka.mcc.id.au>.
Hi Tonny.
Tonny Kohar:
> I have a questions regarding the return value from
> org.apache.batik.dom.util.XMLSupport.defaultXMLSpace(String).
> Does the return value should be without trim ?
My reading would be that due to the Enumeration validity constraint[1],
the attribute value has to match the NMTOKEN production[2], which doesn't
allow spaces. This of course is assuming you are working with a
validated document, and Batik doesn't do any DTD validation.
Cameron
[1] http://www.w3.org/TR/REC-xml/#enum
[2] http://www.w3.org/TR/REC-xml/#nmtok
--
e-mail : cam (at) mcc.id.au icq : 26955922
web : http://mcc.id.au/ msn : cam-msn (at) aka.mcc.id.au
office : +61399055779 jabber : heycam (at) jabber.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org