You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Ragunath Ramaswamy (JIRA)" <xm...@xml.apache.org> on 2006/08/03 00:50:14 UTC

[jira] Created: (XMLBEANS-281) org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour >

org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour &gt;
----------------------------------------------------------------

                 Key: XMLBEANS-281
                 URL: http://issues.apache.org/jira/browse/XMLBEANS-281
             Project: XMLBeans
          Issue Type: Bug
          Components: Tools
    Affects Versions: Version 2.2
         Environment: Windows XP, Intel P4, (I don't think this should matter)
            Reporter: Ragunath Ramaswamy


I have an xml as
<Property name="Test">
    <Value>less than is &lt; greaterthan is &gt;</Value>
</Property>

when I use this as an input to the xpretty command line tool to give the pretty printed output I get the result as

<Property name="Test">
    <Value>less than is &lt; greaterthan is ></Value>
</Property>

I find that the xml escape characters for > are posing an issue here.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


RE: [jira] Resolved: (XMLBEANS-281) org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour >

Posted by Wing Yew Poon <wi...@oracle.com>.
Horatiu,
this is not even an XMLBeans question, this is simply an XML question.
In XML, the character data inside an element must not contain a raw
unescaped open angle bracket (<); this character is always interpreted
as the start of a tag. If you need to use this character, you can
escape it using the built-in entity reference &lt; (or the numeric or
hexadecimal numeric character references). Character data may not contain
a raw unescaped ampersand (&) either. Character data _may_ contain the
raw unescaped closed angle bracket (>).
- Wing Yew

-----Original Message-----
From: horatiu.cherebetiu [mailto:hory191@yahoo.com] 
Sent: Tuesday, June 09, 2009 2:26 AM
To: dev@xmlbeans.apache.org
Subject: Re: [jira] Resolved: (XMLBEANS-281) org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour &gt;


So if I want to have in the output xml file the character ">" or "<" or "&"
not escaped and not in a CDATA tag, is not possible ? 

Regards, 
Horatiu



JIRA xmlbeans-dev@xml.apache.org wrote:
> 
> 
>      [
> https://issues.apache.org/jira/browse/XMLBEANS-281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
> 
> Radu Preotiuc-Pietro resolved XMLBEANS-281.
> -------------------------------------------
> 
>        Resolution: Won't Fix
>     Fix Version/s:  Version 2.3
> 
> In the case of '>' and '&gt;', it goes even beyond pretty-print, because
> from an XML point of view, they are exactly equivalent, so they are not
> preserved regardless.
> 
> XMLBeans 2.3.0 has introduced the XmlOptions.setSaveSubstituteCharacters()
> method, which allows you to specify what characters you want escaped,
> maybe this will help. But the setting is document-wide, so if you want to
> sometimes output '>' and sometimes '&lt;', you are out of luck.
> 
> 
>> org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour &gt;
>> ----------------------------------------------------------------
>>
>>                 Key: XMLBEANS-281
>>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-281
>>             Project: XMLBeans
>>          Issue Type: Bug
>>          Components: Tools
>>    Affects Versions: Version 2.2
>>         Environment: Windows XP, Intel P4, (I don't think this should
>> matter)
>>            Reporter: Ragunath Ramaswamy
>>             Fix For:  Version 2.3
>>
>>
>> I have an xml as
>> <Property name="Test">
>>     <Value>less than is &lt; greaterthan is &gt;</Value>
>> </Property>
>> when I use this as an input to the xpretty command line tool to give the
>> pretty printed output I get the result as
>> <Property name="Test">
>>     <Value>less than is &lt; greaterthan is ></Value>
>> </Property>
>> I find that the xml escape characters for > are posing an issue here.
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-jira--Created%3A-%28XMLBEANS-281%29-org.apache.xmlbeans.impl.tool.PrettyPrinter-does-not-honour--gt--tp5623982p23939395.html
Sent from the Xml Beans - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


Re: [jira] Resolved: (XMLBEANS-281) org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour >

Posted by "horatiu.cherebetiu" <ho...@yahoo.com>.
So if I want to have in the output xml file the character ">" or "<" or "&"
not escaped and not in a CDATA tag, is not possible ? 

Regards, 
Horatiu



JIRA xmlbeans-dev@xml.apache.org wrote:
> 
> 
>      [
> https://issues.apache.org/jira/browse/XMLBEANS-281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
> 
> Radu Preotiuc-Pietro resolved XMLBEANS-281.
> -------------------------------------------
> 
>        Resolution: Won't Fix
>     Fix Version/s:  Version 2.3
> 
> In the case of '>' and '&gt;', it goes even beyond pretty-print, because
> from an XML point of view, they are exactly equivalent, so they are not
> preserved regardless.
> 
> XMLBeans 2.3.0 has introduced the XmlOptions.setSaveSubstituteCharacters()
> method, which allows you to specify what characters you want escaped,
> maybe this will help. But the setting is document-wide, so if you want to
> sometimes output '>' and sometimes '&lt;', you are out of luck.
> 
> 
>> org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour &gt;
>> ----------------------------------------------------------------
>>
>>                 Key: XMLBEANS-281
>>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-281
>>             Project: XMLBeans
>>          Issue Type: Bug
>>          Components: Tools
>>    Affects Versions: Version 2.2
>>         Environment: Windows XP, Intel P4, (I don't think this should
>> matter)
>>            Reporter: Ragunath Ramaswamy
>>             Fix For:  Version 2.3
>>
>>
>> I have an xml as
>> <Property name="Test">
>>     <Value>less than is &lt; greaterthan is &gt;</Value>
>> </Property>
>> when I use this as an input to the xpretty command line tool to give the
>> pretty printed output I get the result as
>> <Property name="Test">
>>     <Value>less than is &lt; greaterthan is ></Value>
>> </Property>
>> I find that the xml escape characters for > are posing an issue here.
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-jira--Created%3A-%28XMLBEANS-281%29-org.apache.xmlbeans.impl.tool.PrettyPrinter-does-not-honour--gt--tp5623982p23939395.html
Sent from the Xml Beans - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Resolved: (XMLBEANS-281) org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour >

Posted by "Radu Preotiuc-Pietro (JIRA)" <xm...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XMLBEANS-281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Preotiuc-Pietro resolved XMLBEANS-281.
-------------------------------------------

       Resolution: Won't Fix
    Fix Version/s:  Version 2.3

In the case of '>' and '&gt;', it goes even beyond pretty-print, because from an XML point of view, they are exactly equivalent, so they are not preserved regardless.

XMLBeans 2.3.0 has introduced the XmlOptions.setSaveSubstituteCharacters() method, which allows you to specify what characters you want escaped, maybe this will help. But the setting is document-wide, so if you want to sometimes output '>' and sometimes '&lt;', you are out of luck.


> org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour &gt;
> ----------------------------------------------------------------
>
>                 Key: XMLBEANS-281
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-281
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: Version 2.2
>         Environment: Windows XP, Intel P4, (I don't think this should matter)
>            Reporter: Ragunath Ramaswamy
>             Fix For:  Version 2.3
>
>
> I have an xml as
> <Property name="Test">
>     <Value>less than is &lt; greaterthan is &gt;</Value>
> </Property>
> when I use this as an input to the xpretty command line tool to give the pretty printed output I get the result as
> <Property name="Test">
>     <Value>less than is &lt; greaterthan is ></Value>
> </Property>
> I find that the xml escape characters for > are posing an issue here.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-281) org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour >

Posted by "Wing Yew Poon (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-281?page=comments#action_12425415 ] 
            
Wing Yew Poon commented on XMLBEANS-281:
----------------------------------------

PrettyPrinter basically parses each xml file you give it into an XmlObject and calls save() on the XmlObject with a pretty print option.
My comment about the character escaping applies to XmlObject save() and xmlText() generally, with or without the pretty print.
As for your observation that pretty printing changes the content of the xml, that is precisely the intent. Pretty printing may add or remove whitespace in the xml content.
E.g., if you pretty printed
<Property name="Test">
    <Value>less than is &lt; greater than is &gt;
  </Value>
</Property>
you get
<Property name="Test">
  <Value>less than is &lt; greater than is ></Value>
</Property>
That is definitely not equivalent as xml to the original.
However,
<Property name="Test">
    <Value>less than is &lt; greater than is >
  </Value>
</Property>
is equivalent to the original.


> org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour &gt;
> ----------------------------------------------------------------
>
>                 Key: XMLBEANS-281
>                 URL: http://issues.apache.org/jira/browse/XMLBEANS-281
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: Version 2.2
>         Environment: Windows XP, Intel P4, (I don't think this should matter)
>            Reporter: Ragunath Ramaswamy
>
> I have an xml as
> <Property name="Test">
>     <Value>less than is &lt; greaterthan is &gt;</Value>
> </Property>
> when I use this as an input to the xpretty command line tool to give the pretty printed output I get the result as
> <Property name="Test">
>     <Value>less than is &lt; greaterthan is ></Value>
> </Property>
> I find that the xml escape characters for > are posing an issue here.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-281) org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour >

Posted by "Wing Yew Poon (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-281?page=comments#action_12425399 ] 
            
Wing Yew Poon commented on XMLBEANS-281:
----------------------------------------

This is not a bug.
The XML spec only requires that '<' and '&'  (and '>' when it is part of the sequence "]]>" AND does not mark the end of a CDATA section) be escaped in character data.
As character data, "&gt;" and ">" are the same.
If you want to control how the '>' is output, you can use XmlOptions.setSaveSubstituteCharacters(XmlOptionCharEscapeMap).


> org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour &gt;
> ----------------------------------------------------------------
>
>                 Key: XMLBEANS-281
>                 URL: http://issues.apache.org/jira/browse/XMLBEANS-281
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: Version 2.2
>         Environment: Windows XP, Intel P4, (I don't think this should matter)
>            Reporter: Ragunath Ramaswamy
>
> I have an xml as
> <Property name="Test">
>     <Value>less than is &lt; greaterthan is &gt;</Value>
> </Property>
> when I use this as an input to the xpretty command line tool to give the pretty printed output I get the result as
> <Property name="Test">
>     <Value>less than is &lt; greaterthan is ></Value>
> </Property>
> I find that the xml escape characters for > are posing an issue here.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-281) org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour >

Posted by "Ragunath Ramaswamy (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-281?page=comments#action_12425403 ] 
            
Ragunath Ramaswamy commented on XMLBEANS-281:
---------------------------------------------

I fully understand that > need not be escaped.

The issue I just stumbled upon here is that this tool actualy changes the content of the xml passed as input in addition to making it pretty printed.

If this is how it is supposed supposed to work. I am sorry for having taken some of your time.

> org.apache.xmlbeans.impl.tool.PrettyPrinter does not honour &gt;
> ----------------------------------------------------------------
>
>                 Key: XMLBEANS-281
>                 URL: http://issues.apache.org/jira/browse/XMLBEANS-281
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: Version 2.2
>         Environment: Windows XP, Intel P4, (I don't think this should matter)
>            Reporter: Ragunath Ramaswamy
>
> I have an xml as
> <Property name="Test">
>     <Value>less than is &lt; greaterthan is &gt;</Value>
> </Property>
> when I use this as an input to the xpretty command line tool to give the pretty printed output I get the result as
> <Property name="Test">
>     <Value>less than is &lt; greaterthan is ></Value>
> </Property>
> I find that the xml escape characters for > are posing an issue here.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org