Yes, it's possible.  There is a usage pattern in the documentation:

   http://xml.apache.org/xalan-c/usagepatterns.html#dom

There is a typo in the usage pattern.  You'll need to replace
DOMSupportDefault with XercesDOMSupport. You'll also not need to follow the
entire usage pattern as it involves both transforming from and to a DOM
document.  You'll also need a tree walker to walk the tree and send events
to the formatter.

Luckily, we've already implemented this in our testXSLT command line
driver.  For all of the gory details, see the file:

   xml-xalan/c/src/TestXSLT/process.cpp

Dave



                                                                                       
      
                    Matt Leinhos                                                       
      
                    <matt@granula        To:     <[EMAIL PROTECTED]>         
      
                    rity.com>            cc:     (bcc: David N Bertoni/CAM/Lotus)      
      
                                         Subject:     Re: xerces-c question            
      
                    07/30/2001                                                         
      
                    06:40 AM                                                           
      
                    Please                                                             
      
                    respond to                                                         
      
                    xerces-c-dev                                                       
      
                                                                                       
      
                                                                                       
      



Another option is to look to xalan-c. It provides the FormatterToXML
class, which will convert 'XalanNode *'s to text. But then, if you're
doing your work with DOM_Nodes, you'll have to convert them to
XalanNodes somehow... Anyone know how/if you can do this?

Matt

On Jul 28, Olivier Schmitt wrote:  -----------------

>But how would you do it, man ?
>just sit back and let the magic work ?
>
>You can write your own serializer class, but it would very much
>look like the domprint sample anyway...
>
>And I think its a good thing people can write there own serialiser class
>because its not always simple to make everybody agree on the details
>of the serialization process (should we insert \n and where ? should we do
>some indentation ? ...)
>
>good luck on your mission ...
>
>Olivier Schmitt
>
>----- Original Message -----
>From: Dodson, John <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Friday, July 27, 2001 5:29 PM
>Subject: RE: xerces-c question
>
>
>> thanks, but i did.  That's precisely why i asked the question.  Do i
>really
>> need to write 100's of lines of code simply to convert a DOM_Document
(or
>> DOM_Element) to a simple string?!  Man.
>>
>> -----Original Message-----
>> From: Olivier Schmitt [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, July 27, 2001 7:28 PM
>> To: [EMAIL PROTECTED]
>> Subject: RE: xerces-c question
>>
>>
>> have a look at the DOMprint sample.
>>
>> -----Original Message-----
>> From: Dodson, John [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, July 27, 2001 8:13 AM
>> To: '[EMAIL PROTECTED]'
>> Subject: xerces-c question
>>
>>
>> So, I have a DOM_Document (or a DOM_Element for that matter), and I want
>> to
>> convert it to a string/byte representation. That is, I want a char * or
>> XMLByte * handle to the actual "XML"  How do I do that w/o writing lots
>> of
>> code?
>>
>> Example:
>>
>> DOM_Document doc;
>>
>> char * str = ???;   //
>> cout << str;      // prints the XML
>>
>> -- or --
>>
>> XMLByte *xmlBytes = ???;
>> cout.write (xmlBytes, ...);   // prints the XML
>>
>> Thanks for any suggestions...
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

--
Matt Leinhos
[EMAIL PROTECTED]

"What's that you say, Mrs. Robinson? Joltin' Joe has left and gone away."
  -- Simon and Garfunkel


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






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

Reply via email to