db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DDLUTILS-245) writeDataToFile produce broken XML
Date Thu, 05 May 2011 06:05:03 GMT

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

Thomas Dudziak resolved DDLUTILS-245.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1

This is fixed in trunk for the 1.1 version. DdlUtils now generates different attributes and/or
sub elements if the table or column name is not a valid tag or contains illegal characters
or is too long for a tag/attribute name. See the schema.xml file in the doc for a description
of the format.

> writeDataToFile produce broken XML
> ----------------------------------
>
>                 Key: DDLUTILS-245
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-245
>             Project: DdlUtils
>          Issue Type: Bug
>          Components: Core (No specific database)
>    Affects Versions: 1.0
>         Environment: JRE 1.5 eclipse 3.4 ant 1.7.1
>            Reporter: Nikolas Falco
>            Assignee: Thomas Dudziak
>            Priority: Blocker
>             Fix For: 1.1
>
>
> databaseToDdl ant task produces a broken XML output if column's name contains special
characters.
> Example of a table schema/data exported:
> SCHEMA.XML
>     <table name="C_RE_FE4FB">
>       <column name="OID$" primaryKey="true" required="true" type="CHAR" size="35"
autoIncrement="false"/>
>       ..
>       <column name="TYPE$_MIMETY_28F8F" primaryKey="false" required="false" type="VARCHAR"
size="256" autoIncrement="false"/>
>       ..
>     </table>
> DATA.XML (broken)
>   <C_RE_FE4FB OID$="8a8081c81f93c944011f93c9b1c4004b   " .. TYPE$_MIMETY_28F8F="TEXT.Xml"
C_MIMETYPE_M_8FBF9="text/xml" .. />
>   <C_RE_FE4FB OID$="8a8081c81f93c944011f93c9b752004f   " .. TYPE$_MIMETY_28F8F="TEXT.Xml"
C_MIMETYPE_M_8FBF9="text/xml" .. />
> A little output log
> [ddlToDatabase] Written schema to database
> [ddlToDatabase] Parse Fatal Error at line 3 column 18: Attribute name "OID" associated
with an element type "C_RE_FE4FB" must be followed by the ' = ' character.
> [ddlToDatabase] org.xml.sax.SAXParseException: Attribute name "OID" associated with an
element type "C_RE_FE4FB" must be followed by the ' = ' character.
> [ddlToDatabase] 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
> [ddlToDatabase] 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
> [ddlToDatabase] 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
> [ddlToDatabase] 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
> [ddlToDatabase] 	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438)
> [ddlToDatabase] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1016)
> [ddlToDatabase] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:851)
> [ddlToDatabase] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
> [ddlToDatabase] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
> [ddlToDatabase] 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
> Should be change data.xml output format. Column name (as also table name) should be converted
from attriute to value to avoid special characters.
> Can become:
> <table="C_RE_FE4FB" column1="OID$" value1="8a8081c81f93c944011f93c9b1c4004b   " ..
columnN="TYPE$_MIMETY_28F8F" valueN="TEXT.Xml" C_MIMETYPE_M_8FBF9="text/xml" .. />

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message