XMLPropertyListParser.parse(Document document) - remains private

53 views
Skip to first unread message

Amarnath BS

unread,
Jul 22, 2015, 8:08:10 AM7/22/15
to plist-discuss
what is the way to pass a document and get NSObject out of that ? 
For security reasons, i would parse the stream and get a Document object and will pass that to XMLPropertyListParser to get back NSObject.. suggestions?

Daniel Dreibrodt

unread,
Jul 22, 2015, 9:41:25 AM7/22/15
to plist-...@googlegroups.com

Hi,

The parseDocument method of XMLPropertyListParser would need to be made public.

The dirty way would be to reencode the document and pass the XML as bytes to the public parsing methods.

What prevents you from directly using the source from which you create the document? The source is not modified in any way by the parser code.

BR,
Daniel

Am 22.07.2015 2:08 nachm. schrieb "Amarnath BS" <amarna...@gmail.com>:
what is the way to pass a document and get NSObject out of that ? 
For security reasons, i would parse the stream and get a Document object and will pass that to XMLPropertyListParser to get back NSObject.. suggestions?

--
You received this message because you are subscribed to the Google Groups "plist-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plist-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Amarnath BS

unread,
Jul 22, 2015, 10:15:22 PM7/22/15
to plist-...@googlegroups.com
Hi, 

Thanks for the swift response. 

To avoid billion laugh attack we have our own implementation to parse the stream and get document which cannot be skipped. 

Can the parseDocument method made public?

--
Amarnath
You received this message because you are subscribed to a topic in the Google Groups "plist-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plist-discuss/pJrAETbWcf4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plist-discus...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
--
Amarnath

Daniel Dreibrodt

unread,
Jul 23, 2015, 1:33:35 PM7/23/15
to plist-...@googlegroups.com

Hi Amarnath,

 

I renamed the method from parseDocument to parse and made it public. You can find the latest code on GitHub.

 

BR,

Daniel

Amarnath BS

unread,
Jul 24, 2015, 2:23:16 AM7/24/15
to plist-...@googlegroups.com
Daniel,

Thanks for the changes. Can you please tag it / make a minor release. It would be great if we can get it as a jar. (previously we used the jar from the zip dd-plist-r116-bin.zip)

Thanks again.

--
Amarnath

--
Amarnath

Amarnath BS

unread,
Jul 28, 2015, 5:46:22 AM7/28/15
to plist-...@googlegroups.com
Daniel,

Your response is appreciated. 

--
Amarnath

Daniel Dreibrodt

unread,
Jul 28, 2015, 1:58:31 PM7/28/15
to plist-...@googlegroups.com

Hi,

 

Release 1.17 has been tagged and binaries uploaded to GitHub.

Arjohn Kampman

unread,
Oct 26, 2015, 9:53:38 AM10/26/15
to plist-discuss
Hi,

Can the 1.17 code be published to the maven server? I would also like to make use of the now public parse(Document) method. Main reason for me is that the other methods fail with the exception below on data that specifies a SYSTEM DOCTYPE:

File header:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">

Exception:
java.io.FileNotFoundException: \System\Library\DTDs\PropertyList.dtd (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method) ~[na:1.7.0_80]
    at java.io.FileInputStream.<init>(Unknown Source) ~[na:1.7.0_80]
    at java.io.FileInputStream.<init>(Unknown Source) ~[na:1.7.0_80]
    at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source) ~[na:1.7.0_80]
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source) ~[na:1.7.0_80]
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source) ~[na:1.7.0_80]
    at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) ~[na:1.7.0_80]
    at com.dd.plist.XMLPropertyListParser.parse(XMLPropertyListParser.java:147) ~[dd-plist-1.16.jar:na]

Thanks,

Arjohn Kampman
Reply all
Reply to author
Forward
0 new messages