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

List:       xmlbeans-dev
Subject:    [jira] Created: (XMLBEANS-384) Using the pretty print option
From:       "Scott Roeske (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2008-10-15 16:20:44
Message-ID: 1394515900.1224087644496.JavaMail.jira () brutus
[Download RAW message or body]

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