"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);

> Knowing next to nothing about the DOM, I am essentially following
> the sample apps' example blindly.  After completing the model, I am
> emitting it as XML using XML::Xerces::DOMParse::format() and
> XML::Xerces::DOMParse::print().

DOMParse::print() works well (although the interface was designed by
Tom Watson a couple of years ago and really needs an overhaul), but if
you want something simpler just use the serialize() method for
DOM_Node. It won't format the output, but in most cases, that's
unnecessary. 

> 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 ;-)

> 1. How can I set the additional pieces of the DOCTYPE from
> Xerces-P?  I can set the name, but I do not see any way to
> set the SYSTEM/PUBLIC identifier keyword and the external
> subset URL.  Trying to set them in the createDocumentType()
> call causes a segfault. :-)

See the example above.

> 2. How can I persuade the printing method to *not* turn "
> into &quot; in my processing instructions???  'type="text/css"'
> gets turned into 'type=&quot;text/css&quot;' 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.

> 3. How can I convince the printing/formatting method that *some*
> elements should not be newline-and-indented?  This is adding
> incorrect whitespace.  For instance, something that should be
> 
>   <foo>this is[<bar>something</bar>] to see</foo>
> 
> is being emitted as
> 
>   <foo>this is[
>    <bar>something</bar>] to see
>   </foo>
> 
> The whitespace between '[' and '<bar>something' is screwing up the
> result.

DOMParse may have to be re-written. I haven't looked at it's interface
since I ported it to Xerces.pm-1.3. 

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to