Accessing DOCTYPE information after DB creation?
Friday, 28 March 2014 · 5 messages
HE
Hondros, Constantine (ELS-AMS)28 Mar 2014 12:18 #
Hi all,
I would really like to be able to query a large corpus of documents to get names and counts of the DTDs which are declared in the (somewhat old-fashioned now) DOCTYPE declaration:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE converted-article PUBLIC "-//ES//DTD journal article DTD version 4.5.2//EN//XML" "art452.dtd" [
]>
<converted-article> <!-- etc -->Is there any way to get BaseX to preserve this information? Can I rewrite the doctype declaration into some sort of element node as the DB is being created so that this info can be queried?
Thanks for any tips,
Constantine.
________________________________
Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands.
CG
Christian Grün28 Mar 2014 12:25 #
Hi Constantine,
unfortunately no, because this information is already consumed by the XML parser (i. e., we don’t get to see it at all when the database is being built).
Suggestions from other users with similar problems are welcome. Christian
Quoted text · Hondros, Constantine (ELS-AMS) · 30 lines
> Hi all, > > I would really like to be able to query a large corpus of documents to get > names and counts of the DTDs which are declared in the (somewhat > old-fashioned now) DOCTYPE declaration: > > <?xml version="1.0" encoding="utf-8"?> > <!DOCTYPE converted-article PUBLIC "-//ES//DTD journal article DTD version > 4.5.2//EN//XML" "art452.dtd" [ > ]> > <converted-article> <!-- etc --> > > Is there any way to get BaseX to preserve this information? Can I rewrite > the doctype declaration into some sort of element node as the DB is being > created so that this info can be queried? > > Thanks for any tips, > Constantine. > > ________________________________ > > Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The > Netherlands, Registration No. 33156677, Registered in The Netherlands. > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
IL
Imsieke, Gerrit, le-tex28 Mar 2014 12:31 #
You can preprocess your documents with Andrew Welch’s LexEv parser: http://andrewjwelch.com/lexev/
Quoted text · Christian Grün · 30 lines
On 28.03.2014 12:25, Christian Grün wrote: > Hi Constantine, > > unfortunately no, because this information is already consumed by the > XML parser (i. e., we don’t get to see it at all when the database is > being built). > > Suggestions from other users with similar problems are welcome. > Christian > > >> Hi all, >> >> I would really like to be able to query a large corpus of documents to get >> names and counts of the DTDs which are declared in the (somewhat >> old-fashioned now) DOCTYPE declaration: >> >> <?xml version="1.0" encoding="utf-8"?> >> <!DOCTYPE converted-article PUBLIC "-//ES//DTD journal article DTD version >> 4.5.2//EN//XML" "art452.dtd" [ >> ]> >> <converted-article> <!-- etc --> >> >> Is there any way to get BaseX to preserve this information? Can I rewrite >> the doctype declaration into some sort of element node as the DB is being >> created so that this info can be queried? >> >> Thanks for any tips, >> Constantine. >>
HE
Thanks all,
Unfortunately this is legacy content – and there is an unbelievable amount of it too.
So, I will probably pre-process the content and write the DTD info out into an element or PI node.
org.basex.core.Command.setInput(org.xml.sax.InputSource is) looks like a probable place to do it, after a _very_ quick look at the JavaDoc. However, I am reading the XML from tarfiles using relatively new functionality, so if anyone from the BaseX team wants to suggest an approach to pre-processing XML files from within tarfiles, I would appreciate a few words from you.
BaseX rocks!
Cheers,
Constantine
Quoted text · basex-talk-bounces at mailman.uni-konstanz.de · 38 lines
From: basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] On Behalf Of France Baril Sent: 28 March 2014 15:16 To: Imsieke, Gerrit, le-tex Cc: BaseX Subject: Re: [basex-talk] Accessing DOCTYPE information after DB creation? We moved to schemas, this way I don't lose the schema declaration and users who edit documents from Oxygen (webdav connection) can get all the advantages of editing documents that are linked to their model, including suggestions for enumerated attributes and indent that respect spacing for mixed content. On Fri, Mar 28, 2014 at 7:31 AM, Imsieke, Gerrit, le-tex <gerrit.imsieke at le-tex.de<mailto:gerrit.imsieke at le-tex.de>> wrote: You can preprocess your documents with Andrew Welch’s LexEv parser: http://andrewjwelch.com/lexev/ On 28.03.2014 12:25, Christian Grün wrote: Hi Constantine, unfortunately no, because this information is already consumed by the XML parser (i. e., we don’t get to see it at all when the database is being built). Suggestions from other users with similar problems are welcome. Christian Hi all, I would really like to be able to query a large corpus of documents to get names and counts of the DTDs which are declared in the (somewhat old-fashioned now) DOCTYPE declaration: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE converted-article PUBLIC "-//ES//DTD journal article DTD version 4.5.2//EN//XML" "art452.dtd" [ ]> <converted-article> <!-- etc --> Is there any way to get BaseX to preserve this information? Can I rewrite the doctype declaration into some sort of element node as the DB is being created so that this info can be queried? Thanks for any tips, Constantine. BaseX-Talk mailing list BaseX-Talk at mailman.uni-konstanz.de<mailto:BaseX-Talk at mailman.uni-konstanz.de> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk -- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com<mailto:france.baril at architextus.com> (514) 572-0341 Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands.
FB
We moved to schemas, this way I don't lose the schema declaration and users who edit documents from Oxygen (webdav connection) can get all the advantages of editing documents that are linked to their model, including suggestions for enumerated attributes and indent that respect spacing for mixed content.
Quoted text · le-tex · 44 lines
On Fri, Mar 28, 2014 at 7:31 AM, Imsieke, Gerrit, le-tex < gerrit.imsieke at le-tex.de> wrote: > You can preprocess your documents with Andrew Welch’s LexEv parser: > http://andrewjwelch.com/lexev/ > > > On 28.03.2014 12:25, Christian Grün wrote: > >> Hi Constantine, >> >> unfortunately no, because this information is already consumed by the >> XML parser (i. e., we don’t get to see it at all when the database is >> being built). >> >> Suggestions from other users with similar problems are welcome. >> Christian >> >> >> Hi all, >>> >>> I would really like to be able to query a large corpus of documents to >>> get >>> names and counts of the DTDs which are declared in the (somewhat >>> old-fashioned now) DOCTYPE declaration: >>> >>> <?xml version="1.0" encoding="utf-8"?> >>> <!DOCTYPE converted-article PUBLIC "-//ES//DTD journal article DTD >>> version >>> 4.5.2//EN//XML" "art452.dtd" [ >>> ]> >>> <converted-article> <!-- etc --> >>> >>> Is there any way to get BaseX to preserve this information? Can I rewrite >>> the doctype declaration into some sort of element node as the DB is being >>> created so that this info can be queried? >>> >>> Thanks for any tips, >>> Constantine. >>> >>> _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
(514) 572-0341
Written for BaseX 7.8. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery