Thanks for the assist, Jason. I still have some issues..
"Jason E. Stewart" wrote:
>
> "Rodent of Unusual Size" <[EMAIL PROTECTED]> writes:
>
> > I am using XML::Xerces::DOM_Document::createDocument() to
> > create a DOM tree, and populating it with the appropriate
> > calls as I process the data I want to represent.
>
> I do not know why this interface exists, as far as I can tell, it is
> broken in Xerces-C. Check out the DOMException.t example for creating
> a document using the DOM_DOMIplementation::createDocument interface
> instead:
>
> my $impl = XML::Xerces::DOM_DOMImplementation::getImplementation();
> my $dt = $impl->createDocumentType('Foo', '', 'Foo.dtd');
> my $doc = $impl->createDocument('Foo', 'foo',$dt);
Okey, I tried that, and I ran into an entirely new set of problems:
use XML::Xerces;
use XML::Xerces::DOMParse;
$DOMimpl = XML::Xerces::DOM_DOMImplementation::getImplementation();
$doctype = $DOMimpl->createDocumentType('lexicon', '', 'ap-dict.dtd');
$doc = $DOMimpl->createDocument('lexicon', 'lexicon', $doctype);
$XMLdecl = $doc->createXMLDecl("1.0", "utf-8", 'yes');
$doc->appendChild($XMLdecl);
$XML::Xerces::DOMParse::INDENT = " ";
XML::Xerces::DOMParse::format($doc);
XML::Xerces::DOMParse::print(\*STDOUT, $doc);
gives me
./logerr-extract.pl: couldn't find an XMLDecl node, try
$parser->setToCreateXMLDeclTypeNode(1) at
/usr/local/lib/perl5/site_perl/5.6.0/i686-linux
/XML/Xerces/DOMParse.pm line 269.
Eh?
> > I am finding the Xerces-P and Xerces-C documentation pretty
> > bloody opaque. For instance, one major facet it seems to be
> > missing is *examples*..
>
> Yes, that seems to be everyones comment. So far, I have no
> takers for helping me improve the docs (nor, in fact, have I
> had any volunteers to help me improve the code, which would
> also be welcome ;-)
I would be glad to help out if and how. I do a lot of writing,
and my incredibly neophyte perspective on this stuff might be
useful.
I can tell you right off the top one thing that would make
the docco *much* more useful for me, and possibly others:
ditch the organisation-by-object as the sole index. If I want
details about a createFoo method, I want to be able to go to the
TOC/index and look for "createFoo", not drill down to it through
the object tree. If multiple object types implement createFoo,
fine, list/xref them -- but 'createFoo' should be in the index.
> > 2. How can I persuade the printing method to *not* turn "
> > into " in my processing instructions??? 'type="text/css"'
> > gets turned into 'type="text/css"' which is really
> > annoying..
>
> Hmmm... I would fiddle with
> $parser->setCreateEntityReferenceNodes(). If you set this to '1' it
> should leave your entities alone. Let us know if this succeeds.
Well, I *want* entities encoded everywhere except in the
processing directives.
--
#ken P-)}
Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/
Apache Software Foundation http://www.apache.org/
"Apache Server for Dummies" http://Apache-Server.Com/
"Apache Server Unleashed" http://ApacheUnleashed.Com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]