DOMPrint with chCR/chLF

2001-06-26 Thread Stefan Berglund
Hello, I'm having problems with my app, I've borrowed the functionality of the DOMPrint example to get my parsed XML to a string, and when it "writes out" the XML_DECL_NODE, it uses the constant: static const XMLCh gXMLDecl4[] = { chDoubleQuote, chQuestion, chCloseAngle , chCR, chLF, ch

Re: what's wrong with my code ??

2001-06-26 Thread Stefan Berglund
- Original Message - > void myclass::testAndAdd(DOM_TreeWalker &dtw) >... > { > // first i get back the DOM_Element lying behind the > // DOM_TreeWalker. > DOM_Element elem = (DOM_Element &) dtw.getCurrentNode(); > > // then i performe a few test on it >

Re: getNodeValue().transcode()

2001-06-18 Thread Stefan Berglund
Hi, try: char *value; value = attr.getNodeValue().transcode(); if (strcmp(value, "John") == 0) { printf("Your name is John\n"); } else if (strcmp(value, "Tom") == 0) { printf("Hello, Tom!\n"); } ... delete[] value; Since char * cannot be used in switch() expressions, as it says in the e

How to create a XML document in a good way

2001-06-15 Thread Stefan Berglund
Hello, I'm wondering if there are any nice ways to create a XML document according to some DTD with Xerces. I've made a component using Xerces to read, modify and create new XML documents. All documents should validate OK to a collection of DTD:s, and this is where the trouble is. So far, I've go

Special character coding

2001-05-30 Thread Stefan Berglund
Hello, I'm having problems with character coding in my messages. I'm not that good at character standards etc though.. However - I'm using a DOMParser in Xerces-C 1.4 with ISO-8859-1 encoding. I've coded a component that parses a message, modifies it, and returns the modified message in C++ STL

How to check mandatory/optional elements

2001-05-22 Thread Stefan Berglund
Hello all, Is there an easy way to check if a certain element (name given) exists somewhere in the DTD(s), and if it's optional or not? I've recently started working with Xerces, in a communicating-interface-component thingy, using a DOMParser to validate messages and then extract certain values