[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] Resolved: (XMLBEANS-384) Using the pretty print option
From:       "Cezar Andrei (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2009-10-26 21:02:59
Message-ID: 1963222523.1256590979498.JavaMail.jira () brutus
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/XMLBEANS-384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Cezar Andrei resolved XMLBEANS-384.
-----------------------------------

    Resolution: Won't Fix

Pretty print option works by introducing spaces, if in your application the spaces \
might have semantics do not use pretty print option (or toString() which implies \
pretty print).

> Using the pretty print option results in invalid XML if processing instructions are \
>                 embedded in enumerated elements
> -------------------------------------------------------------------------------------------------------------------
>  
> Key: XMLBEANS-384
> URL: https://issues.apache.org/jira/browse/XMLBEANS-384
> Project: XMLBeans
> Issue Type: Bug
> Affects Versions: Version 2.4 
> Reporter: Scott Roeske
> Priority: Minor
> 
> If an element contains a processing instruction, it is separated into multiple \
> lines when using the pretty print option.  For example:   
> <elem><?proc_instr?>text</elem>
> Becomes:
> <elem>
> <?proc_instr?>
> text
> </elem>
> This causes problems if the element is an enumerated type since the extra \
> whitespace results in invalid XML.  If the output is subsequently parsed, then the \
> following exception is raised when trying to validate the document or trying to \
>                 access the value:
> org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: string value '
> 
> text
> ' is not a valid enumeration value for type of elem element in type of element doc
> In this case, the newlines that have been introduced have resulted in a value that \
> does not match any of the valid enumerated types.   The workaround is to use the \
> "strip whitespace" option when parsing the output, which collapses the value back \
> to a single line and results in valid XML again.  However, this workaround may not \
> always be possible or desirable, and it would be preferable if the pretty print \
> output could result in valid XML from the outset. 

-- 
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic