You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by mikenereson, Sep 12, 2011
Is it possible to set the doctype?
I have an english properties file that I translate to several other languages. It seems in order for Properties#loadFromXML to work I need to include a doctype:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
Exception in thread "main" java.util.InvalidPropertiesFormatException: org.xml.sax.SAXParseException: Document root element "properties", must match DOCTYPE root "null".
at java.util.XMLUtils.load(XMLUtils.java:59)
at java.util.Properties.loadFromXML(Properties.java:852)
at com.retrieve.XmlApp.main(XmlApp.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.xml.sax.SAXParseException: Document root element "properties", must match DOCTYPE root "null".
Sep 12, 2011 Delete comment #2 mikenereson
My solution, for the record, while waiting to hear if this functionality is available in XML tool, was to write the XML file out, then read it back in add the doctype and write it out again.
Sep 12, 2011 Delete comment Project Member #3 mathieu.carbou
Hi,
Thanks for the report, this is definitely a feature that should be added. I'll try to do my best to spend time on it, plus other requests, by the end of the month and release a new version. I am very busy at the moment.
Status: Accepted
Owner: mathieu.carbou
Labels: Type-Enhancement Priority-High Milestone-Release3.4
Sep 12, 2011 Delete comment #4 mikenereson
Mathieu, don't rush for me. I have a solution that works. I really just wasn't sure if I was not looking in the right place, or if it was a missing feature.
I thought I could get at the underlying dom builder, or something, to set the value, but if its a missing feature, then you've confirmed that its not at this time possible to do this.
Thanks, for the tool. Been using it on several projects since 2008.
The text was updated successfully, but these errors were encountered:
Reported by mikenereson, Sep 12, 2011
Is it possible to set the doctype?
I have an english properties file that I translate to several other languages. It seems in order for Properties#loadFromXML to work I need to include a doctype:
Properties#loadFromXML
http://download.oracle.com/javase/1,5.0/docs/api/java/util/Properties.html#loadFromXML(java.io.InputStream)
Sep 12, 2011 Delete comment #1 mikenereson
Not your problem, not information nontheless, here is the stacktrace from trying to load the file created with XML tool
And here is a sample of the file being loaded.
Sep 12, 2011 Delete comment #2 mikenereson
My solution, for the record, while waiting to hear if this functionality is available in XML tool, was to write the XML file out, then read it back in add the doctype and write it out again.
http://www.exampledepot.com/egs/javax.xml.transform/SetDocType.html
resulting in
Sep 12, 2011 Delete comment Project Member #3 mathieu.carbou
Hi,
Thanks for the report, this is definitely a feature that should be added. I'll try to do my best to spend time on it, plus other requests, by the end of the month and release a new version. I am very busy at the moment.
Status: Accepted
Owner: mathieu.carbou
Labels: Type-Enhancement Priority-High Milestone-Release3.4
Sep 12, 2011 Delete comment #4 mikenereson
Mathieu, don't rush for me. I have a solution that works. I really just wasn't sure if I was not looking in the right place, or if it was a missing feature.
I thought I could get at the underlying dom builder, or something, to set the value, but if its a missing feature, then you've confirmed that its not at this time possible to do this.
Thanks, for the tool. Been using it on several projects since 2008.
The text was updated successfully, but these errors were encountered: