Thanks, everyone--I really appreciate the quick and thorough responses. I'm able to get the stylesheet PI in now and will find another way to add the XML declaration when the file is consumed outside of ML.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Geert Josten Sent: Wednesday, June 10, 2009 2:40 PM To: General Mark Logic Developer Discussion Subject: RE: [MarkLogic Dev General] Adding processing instructions to thedocument node Steward, Just to add: MarkLogic doesn't need this XML declaration in its storage itself. But I can imagine that you may need it once extracted a document out of MarkLogic. You can add this XML declaration to the response message when sending back the contents over HTTP for instance. Danny explains how to do this in this message: http://markmail.org/message/kwu24lbcdrt2dcim Kind regards, Geert > Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of > Mary Holstege > Sent: woensdag 10 juni 2009 22:30 > To: General Mark Logic Developer Discussion > Subject: Re: [MarkLogic Dev General] Adding processing > instructions to the document node > > On Wed, 10 Jun 2009 11:36:54 -0700, Stewart Shelline > <[email protected]> wrote: > > > I need to be able to add processing instructions to > documents I create > > and store in ML. I assumed the following would accomplish that: > > > > let $xml-version := <?xml version="1.0" encoding="UTF-8"?> > > let $stylesheet := <?xml-stylesheet type='text/xsl' > > > href='http://ldschurch.dataformat.com/local/PMDC_TEISchema_Nor > mal.xsl'?> > > let $tei := <teiCorpus ...>...</teiCorpus> > > return xdmp:document-insert( $uri, > ($xml-version,$stylesheet,$tei) > > ) > > > > However, this throws the following error: > > > > XDMP-XMLPI: (err:XPST0003) <?xml version="1.0" > encoding="UTF-8"?> > > -- Processing instructions may not have the target 'XML' > > > > Sorry for the newbie question, but what am I missing here? > > The first one is not, in fact, a processing instruction. I > know it looks exactly like one, but technically it is the XML > declaration. In XQuery you are not allowed to construct a > processing instruction that has "xml" > as its target precisely to prevent you from trying to > construct the XML declaration in this way. And that is > because the XML declaration is really a hint for the XML > parser and therefore exists outside of the scope of the XML > data model, which is all XQuery knows about. > > Even setting that aside, you want to set up your insert a > little differently like so: > > xdmp:document-insert( $uri, document { $stylesheet, $tei } ) > > (Document insert is expecting a single node.) > > //Mary > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
