Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. DOMLSSerializer (from Xerces-C++ 3.0) on QtXML
Forum Updated to NodeBB v4.3 + New Features

DOMLSSerializer (from Xerces-C++ 3.0) on QtXML

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 4.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jabtcha
    wrote on last edited by
    #1

    On Xerces-C++ 3.0 we can do something like:
    @
    DOMLSSerializer* serializer = ((DOMImplementationLS*)impl)->createLSSerializer();
    if (serializer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTDiscardDefaultContent, true)) {
    serializer->getDomConfig()->setParameter(XMLUni::fgDOMWRTDiscardDefaultContent, true);
    }

    if (serializer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true)){
        serializer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true);
    }
    
     XMLFormatTarget *myFormTarget = new LocalFileFormatTarget(strFileName.c_str());
    
     DOMLSOutput* theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
     theOutput->setByteStream(myFormTarget);
    
     serializer->write(delemConfig, theOutput);
    

    @

    What would be the corresponding API using QtXML?
    I'm porting a code from Xerces to QtXML but sometimes it is hard to find a direct mapping from one API to the other...

    On this example, even if I were using the old Xerces-C++ 2.0 API with DOMWriter::writeNode I still wouldn't be able to find the mapping on Qt.

    thanks in advance!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      I am not familiar with Xerces, and I don't know what the code above does exactly. But, did you take a look at that QXmlStreamWriter class?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved