From c-userskaitlin41@example.org Tue Apr 05 13:04:42 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 32160 invoked from network); 5 Apr 2011 13:04:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Apr 2011 13:04:42 -0000 Received: (qmail 15149 invoked by uid 500); 5 Apr 2011 13:04:42 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 15081 invoked by uid 500); 5 Apr 2011 13:04:42 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 15073 invoked by uid 99); 5 Apr 2011 13:04:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Apr 2011 13:04:42 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO smtp145.iad.emailsrvr.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Apr 2011 13:04:36 +0000 Received: from localhost (localhost.localdomain [83.161.120.155]) by smtp54.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 307432B05AE; Tue, 5 Apr 2011 09:04:15 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp54.relay.iad1a.emailsrvr.com (Authenticated sender: manish.yadav-AT-orkash.com) with ESMTPSA id 669322B0563 for <kaitlin41@example.org>; Tue, 5 Apr 2011 09:04:14 -0400 (EDT) Message-ID: <kaitlin41@example.org> Date: Tue, 05 Apr 2011 18:34:13 +0530 From: Manish Yadav <kaitlin41@example.org> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:83.161.120.155) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: kaitlin41@example.org Subject: xml parsing problem Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit hi every body i'm new to c++ and xerces. i'm triying to make change in an xml file using xerces dom parser. my xml file which i want to change is following : its name is sel.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>fs.default.name</name> <value> name</value> </property> </configuration> i want to change <value>name</value> to <value>next</next> my cpp file code is following: #include<string.h> #include<iostream> #include<sstream> #include<sys/types.h> #include<unistd.h> #include<errno.h> #include<sys/stat.h> #include "parser1.hpp" #include <typeinfo> using namespace xercesc ; using namespace std; GetConfig888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4GetConfig() { XMLPlatformUtils888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Initialize(); TAG_configuration =XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("configuration"); TAG_property = XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("property"); TAG_name=XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("name"); TAG_value=XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("value"); m_ConfigFileParser=new XercesDOMParser; } GetConfig888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4~GetConfig() { delete m_ConfigFileParser; XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_configuration ); XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_property ); //XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_value ); //XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_name ); XMLPlatformUtils888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Terminate(); } void GetConfig 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 readConfigFile(string& configFile) throw( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error ) { /*struct stat fileStatus; int iretStat = stat(configFile.c_str(), &fileStatus); if( iretStat == ENOENT ) throw ( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error("Path file_name does not exist, or path is an empty string.") ); else if( iretStat == ENOTDIR ) throw ( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error("A component of the path is not a directory.")); else if( iretStat == ELOOP ) throw ( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error("Too many symbolic links encountered while traversing the path.")); else if( iretStat == EACCES ) throw ( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error("Permission denied.")); else if( iretStat == ENAMETOOLONG ) throw ( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error("File can not be read\n")); */ // Configure DOM parser. m_ConfigFileParser->setValidationScheme( XercesDOMParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Val_Never ); m_ConfigFileParser->setDoNamespaces( false ); m_ConfigFileParser->setDoSchema( false ); m_ConfigFileParser->setLoadExternalDTD( false ); m_ConfigFileParser->parse( configFile.c_str() ); DOMDocument* doc = m_ConfigFileParser->getDocument(); DOMElement *root = doc->getDocumentElement(); const XMLCh* tag = xerces888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("property"); const XMLCh* tag1 = xerces888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("value"); const XMLCh* tag2 = xerces888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("name"); //DOMNodeList * list= doc->getElementbyTagName("tag"); //cout<<moot; //DOMNode * rootElem = doc->getDocumentElement(); cout << "\nfirst"; //DOMNode *root = doc->getFirstChild() ; cout << "\nsecond\n"; cout<< root<<"\n" ; if ( root ) { cout<<"hi\n"; DOMElement* property = dynamic_cast<DOMElement*>( root->getElementsByTagName( tag )->item( 0) ); if ( property ) { cout<<"hello"; DOMElement* name = dynamic_cast<DOMElement*>( property->getElementsByTagName( tag2 )->item( 0 ) ); if ( name ) { cout<<"\nmanish\n"; DOMElement* value = dynamic_cast<DOMElement*>( property->getElementsByTagName( tag1 )->item( 0 ) ); if ( value ) { cout<<XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode(value->getTextContent()); cout<<"\n"; value->setTextContent( XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode(" next") ); // this will update the element named "value" } } } } int main() { string configFile="/home/manish.yadav/Desktop/sel.xml"; GetConfig appConfig; appConfig.readConfigFile(configFile); return 0; } i compiled the program successfully and the program is running correctly it shows the out put like that first second 0x1314e50 hi hello manish name the extra output are becoz i want to check the flow control of program now my problem is that i used the method value->setTextContent( XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode(" next") ); it is not working ; in my xml file i saw the old value. the value is not changing there what should i do so that the value change in sel.xml file too? what should i do to change the value in xml file ? what i 'm doing wrong? i goggled the matter lot but someone saying i cant make change in xml file . to change xml file i have to read the content of file and create a new file . can anybody explain what should i do? i read the dom Programming guide, api Documentation but nothing substantial. what is the method or way to read from old xml file and write it to a new file ? can any body explain with code ? how to make new xml file using dom c++ parser? From c-userskaitlin41@example.org Tue Apr 05 14:35:57 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 36517 invoked from network); 5 Apr 2011 14:35:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Apr 2011 14:35:57 -0000 Received: (qmail 64480 invoked by uid 500); 5 Apr 2011 14:35:56 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 64454 invoked by uid 500); 5 Apr 2011 14:35:56 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 64446 invoked by uid 99); 5 Apr 2011 14:35:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Apr 2011 14:35:56 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO ns1.mebius.net) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Apr 2011 14:35:47 +0000 Received: from bbs2.mebius.net (root@bbs2 [83.161.120.155]) by ns1.mebius.net (8.14.3/8.14.3) with ESMTP id p35EZQha020963 for <kaitlin41@example.org>; Tue, 5 Apr 2011 17:35:26 +0300 Received: from [83.161.120.155] (marl.minsk.mebius.net [83.161.120.155]) by bbs2.mebius.net (8.11.6/8.11.6) with ESMTP id p35EZPl02434 for <kaitlin41@example.org>; Tue, 5 Apr 2011 17:35:26 +0300 Message-ID: <kaitlin41@example.org> Date: Tue, 05 Apr 2011 17:35:25 +0300 From: Vitaly Prapirny <kaitlin41@example.org> Organization: Mebius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:83.161.120.155) Gecko/20110320 SeaMonkey/2.0.13 MIME-Version: 1.0 To: kaitlin41@example.org Subject: Re: xml parsing problem References: <kaitlin41@example.org> In-Reply-To: <kaitlin41@example.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I suggest you to search the DOMLSSerializer class in the Xerces-C++ documentation and samples. Hope this helps. Good luck! Vitaly Manish Yadav wrote: > hi every body > i'm new to c++ and xerces. i'm triying to make change in an xml file > using xerces dom parser. my xml file which i want to change is following > : its name is sel.xml > > <?xml version="1.0"?> > <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> > > <!-- Put site-specific property overrides in this file. --> > > <configuration> > <property> > <name>fs.default.name</name> > <value> name</value> > </property> > > </configuration> > > i want to change <value>name</value> to <value>next</next> > > my cpp file code is following: > > #include<string.h> > #include<iostream> > #include<sstream> > #include<sys/types.h> > #include<unistd.h> > #include<errno.h> > #include<sys/stat.h> > #include "parser1.hpp" > #include <typeinfo> > using namespace xercesc ; > using namespace std; > > GetConfig888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4GetConfig() > { > XMLPlatformUtils888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Initialize(); > TAG_configuration =XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("configuration"); > TAG_property = XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("property"); > TAG_name=XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("name"); > TAG_value=XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("value"); > m_ConfigFileParser=new XercesDOMParser; > } > GetConfig888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4~GetConfig() > { > delete m_ConfigFileParser; > > XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_configuration ); > XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_property ); > //XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_value ); > //XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_name ); > XMLPlatformUtils888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Terminate(); > } > void GetConfig 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 readConfigFile(string& configFile) > throw( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error ) > { > /*struct stat fileStatus; > int iretStat = stat(configFile.c_str(), &fileStatus); > if( iretStat == ENOENT ) > throw ( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error("Path file_name does not exist, or path is an > empty string.") ); > else if( iretStat == ENOTDIR ) > throw ( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error("A component of the path is not a directory.")); > else if( iretStat == ELOOP ) > throw ( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error("Too many symbolic links encountered while > traversing the path.")); > else if( iretStat == EACCES ) > throw ( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error("Permission denied.")); > else if( iretStat == ENAMETOOLONG ) > throw ( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error("File can not be read\n")); > */ > // Configure DOM parser. > > m_ConfigFileParser->setValidationScheme( XercesDOMParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Val_Never ); > m_ConfigFileParser->setDoNamespaces( false ); > m_ConfigFileParser->setDoSchema( false ); > m_ConfigFileParser->setLoadExternalDTD( false ); > > m_ConfigFileParser->parse( configFile.c_str() ); > > DOMDocument* doc = m_ConfigFileParser->getDocument(); > DOMElement *root = doc->getDocumentElement(); > const XMLCh* tag = xerces888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("property"); > const XMLCh* tag1 = xerces888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("value"); > const XMLCh* tag2 = xerces888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("name"); > //DOMNodeList * list= doc->getElementbyTagName("tag"); > //cout<<moot; > > //DOMNode * rootElem = doc->getDocumentElement(); > > > cout << "\nfirst"; > > > //DOMNode *root = doc->getFirstChild() ; > > cout << "\nsecond\n"; > cout<< root<<"\n" ; > > if ( root ) > { > cout<<"hi\n"; > DOMElement* property = dynamic_cast<DOMElement*>( > root->getElementsByTagName( tag )->item( 0) ); > > if ( property ) > { > cout<<"hello"; > DOMElement* name = dynamic_cast<DOMElement*>( > property->getElementsByTagName( tag2 )->item( 0 ) ); > > if ( name ) > { > cout<<"\nmanish\n"; > > DOMElement* value = dynamic_cast<DOMElement*>( > property->getElementsByTagName( tag1 )->item( 0 ) ); > > if ( value ) > { > cout<<XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode(value->getTextContent()); > cout<<"\n"; > value->setTextContent( XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode(" next") ); // this will > update the element named "value" > } > } > } > } > > int main() > { > string configFile="/home/manish.yadav/Desktop/sel.xml"; > > GetConfig appConfig; > > appConfig.readConfigFile(configFile); > > > return 0; > } > > i compiled the program successfully and the program is running correctly > it shows the out put like that > > first > second > 0x1314e50 > hi > hello > manish > name > the extra output are becoz i want to check the flow control of program > > now my problem is that i used the method value->setTextContent( > XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode(" next") ); > it is not working ; > in my xml file i saw the old value. the value is not changing there what > should i do so that the value change in sel.xml file too? > what should i do to change the value in xml file ? > what i 'm doing wrong? > i goggled the matter lot but someone saying i cant make change in xml > file . > to change xml file i have to read the content of file and create a new > file . > can anybody explain what should i do? > i read the dom Programming guide, api Documentation but nothing > substantial. > what is the method or way to read from old xml file and write it to a > new file ? > can any body explain with code ? > how to make new xml file using dom c++ parser? > > > > From c-userskaitlin41@example.org Wed Apr 06 07:36:21 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 64491 invoked from network); 6 Apr 2011 07:36:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Apr 2011 07:36:21 -0000 Received: (qmail 14591 invoked by uid 500); 6 Apr 2011 07:36:20 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 14427 invoked by uid 500); 6 Apr 2011 07:36:19 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 14413 invoked by uid 99); 6 Apr 2011 07:36:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Apr 2011 07:36:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO ns1.mebius.net) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Apr 2011 07:36:08 +0000 Received: from bbs2.mebius.net (root@bbs2 [83.161.120.155]) by ns1.mebius.net (8.14.3/8.14.3) with ESMTP id p367ZhEn017567; Wed, 6 Apr 2011 10:35:43 +0300 Received: from [83.161.120.155] (marl.minsk.mebius.net [83.161.120.155]) by bbs2.mebius.net (8.11.6/8.11.6) with ESMTP id p367Zgl07636; Wed, 6 Apr 2011 10:35:43 +0300 Message-ID: <kaitlin41@example.org> Date: Wed, 06 Apr 2011 10:35:43 +0300 From: Vitaly Prapirny <kaitlin41@example.org> Organization: Mebius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:83.161.120.155) Gecko/20110320 SeaMonkey/2.0.13 MIME-Version: 1.0 To: kaitlin41@example.org CC: Manish Yadav <kaitlin41@example.org> Subject: Re: Thank You References: <kaitlin41@example.org> In-Reply-To: <kaitlin41@example.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Manish Yadav wrote: > hi > thanks for your reply. I searched for DOMLSSerializer class in the > Xerces-C++ and samples but nothing clear. I don't know what is not clear enough so i can't provide more clear information about this, sorry. > why can we just sinmple > Domserialization class? I do know nothing about Domserialization class. > please help me and tell me how to do this ? > You can make your own serializer by traversing a DOM tree and saving the data of every node to some file. Or you can try some more easy to use library, e.g., http://www.codesynthesis.com/products/xsd/ Good luck! Vitaly From c-userskaitlin41@example.org Thu Apr 07 03:49:10 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 35595 invoked from network); 7 Apr 2011 03:49:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Apr 2011 03:49:10 -0000 Received: (qmail 2668 invoked by uid 500); 7 Apr 2011 03:49:10 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 2565 invoked by uid 500); 7 Apr 2011 03:49:10 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 2554 invoked by uid 99); 7 Apr 2011 03:49:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 03:49:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO smtp165.dfw.emailsrvr.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 03:48:58 +0000 Received: from localhost (localhost.localdomain [83.161.120.155]) by smtp16.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 5348C404C0; Wed, 6 Apr 2011 23:48:37 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp16.relay.dfw1a.emailsrvr.com (Authenticated sender: manish.yadav-AT-orkash.com) with ESMTPSA id 5BCD14044C for <kaitlin41@example.org>; Wed, 6 Apr 2011 23:48:36 -0400 (EDT) Message-ID: <kaitlin41@example.org> Date: Thu, 07 Apr 2011 09:18:27 +0530 From: Manish Yadav <kaitlin41@example.org> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:83.161.120.155) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: kaitlin41@example.org Subject: Re: Thank You References: <kaitlin41@example.org> <kaitlin41@example.org> In-Reply-To: <kaitlin41@example.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Wednesday 06 April 2011 01:05 PM, Vitaly Prapirny wrote: > Manish Yadav wrote: >> hi >> thanks for your reply. I searched for DOMLSSerializer class in the >> Xerces-C++ and samples but nothing clear. > > I don't know what is not clear enough so i can't provide more clear > information about this, sorry. > >> why can we just sinmple >> Domserialization class? > > I do know nothing about Domserialization class. > >> please help me and tell me how to do this ? >> > > You can make your own serializer by traversing a DOM tree and saving > the data of every node to some file. Or you can try some more easy to > use library, e.g., http://www.codesynthesis.com/products/xsd/ > > Good luck! > Vitaly Hi Thank You for reply and help, sorry I'm bothering you again but you seems to be the person who can help me .Please help this novice fellow. Can You explain me the proper process how to use xsd ? How to do this in Xerces c++ coz i need it in c++? Here is my actual problem , I want to change a tag value in a xml file using xcerses c++ dom parser my xml file is this ?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>fs.default.name</name> <value> name</value> </property> </configuration> I just want to change <value> name </value> to <value>next</value> nobody in my mates or teachers know about xml parsing top of all there is no proper documentation which explain this process. so will You tell me how to do this using xcerces ? i wrote a c++ code. when i run it on out put it shows paramater changed but when i saw the file on my disk there is no change . so will you see the code and tell me what i'm doing wrong? my c++ code is following: #include<string.h> #include<iostream> #include<sstream> #include<sys/types.h> #include<unistd.h> #include<errno.h> #include<sys/stat.h> #include "parser1.hpp" #include <typeinfo> using namespace xercesc ; using namespace std; GetConfig888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4GetConfig() { XMLPlatformUtils888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Initialize(); TAG_configuration =XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("configuration"); TAG_property = XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("property"); TAG_name=XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("name"); TAG_value=XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("value"); m_ConfigFileParser=new XercesDOMParser; } GetConfig888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4~GetConfig() { delete m_ConfigFileParser; XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_configuration ); XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_property ); XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_value ); XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4release( &TAG_name ); XMLPlatformUtils888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Terminate(); } void GetConfig 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4 readConfigFile(string& configFile) throw( st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4runtime_error ) { // Configure DOM parser. m_ConfigFileParser->setValidationScheme( XercesDOMParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4Val_Never ); m_ConfigFileParser->setDoNamespaces( false ); m_ConfigFileParser->setDoSchema( false ); m_ConfigFileParser->setLoadExternalDTD( false ); m_ConfigFileParser->parse( configFile.c_str() ); DOMDocument* doc = m_ConfigFileParser->getDocument(); DOMElement *root = doc->getDocumentElement(); const XMLCh* tag = xerces888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("property"); const XMLCh* tag1 = xerces888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("value"); const XMLCh* tag2 = xerces888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode("name"); //DOMNodeList * list= doc->getElementbyTagName("tag"); //cout<<moot; //DOMNode * rootElem = doc->getDocumentElement(); cout << "\nfirst"; //DOMNode *root = doc->getFirstChild() ; cout << "\nsecond\n"; cout<< root<<"\n" ; if ( root ) { cout<<"hi\n"; DOMElement* property = dynamic_cast<DOMElement*>( root->getElementsByTagName( tag )->item( 0) ); if ( property ) { cout<<"hello"; DOMElement* name = dynamic_cast<DOMElement*>( property->getElementsByTagName( tag2 )->item( 0 ) ); if ( name ) { cout<<"\nmanish\n"; DOMElement* value = dynamic_cast<DOMElement*>( property->getElementsByTagName( tag1 )->item( 0 ) ); if ( value ) { cout<<XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode(value->getTextContent()); cout<<"\n"; value->setTextContent( XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode(" next") ); // this will update the element named "value" cout<<XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4transcode(value->getTextContent()); cout<<"\n"; } } } } } int main() { string configFile="/home/manish.yadav/Desktop/sel.xml"; GetConfig appConfig; appConfig.readConfigFile(configFile); return 0; } one more question most of the people say You cant change the xml file through c++ program or dom parser.Most of them say you have traverse the whole file and write back it to a new file reach the node where you need the change and write it to a new file. delete the old file and rename the new file . Is it true? if its true Then will you explain me how to do this ? why cant we change a xml file without writing to a new file ?Is there any way possible so that we can make changes in xml file without writing it to a new file ? if there is a way will you explain me how to do this ? please help me with these doubts Manish From c-userskaitlin41@example.org Thu Apr 07 09:23:18 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 7733 invoked from network); 7 Apr 2011 09:23:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Apr 2011 09:23:18 -0000 Received: (qmail 69619 invoked by uid 500); 7 Apr 2011 09:23:18 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 69498 invoked by uid 500); 7 Apr 2011 09:23:15 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 69490 invoked by uid 99); 7 Apr 2011 09:23:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 09:23:14 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO ns1.mebius.net) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 09:23:04 +0000 Received: from bbs2.mebius.net (root@bbs2 [83.161.120.155]) by ns1.mebius.net (8.14.3/8.14.3) with ESMTP id p379MhBi015118 for <kaitlin41@example.org>; Thu, 7 Apr 2011 12:22:43 +0300 Received: from [83.161.120.155] (marl.minsk.mebius.net [83.161.120.155]) by bbs2.mebius.net (8.11.6/8.11.6) with ESMTP id p379Mgl05380 for <kaitlin41@example.org>; Thu, 7 Apr 2011 12:22:42 +0300 Message-ID: <kaitlin41@example.org> Date: Thu, 07 Apr 2011 12:22:43 +0300 From: Vitaly Prapirny <kaitlin41@example.org> Organization: Mebius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:83.161.120.155) Gecko/20110320 SeaMonkey/2.0.13 MIME-Version: 1.0 To: kaitlin41@example.org Subject: Re: Thank You References: <kaitlin41@example.org> <kaitlin41@example.org> <kaitlin41@example.org> In-Reply-To: <kaitlin41@example.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Manish Yadav wrote: > Can You explain me the proper process how to use xsd ? How to do this in > Xerces c++ coz i need it in c++? Please look for this information in the CodeSynthesis XSD documentation. Or use support mailing lists as described on the CodeSynthesis XSD web page. > i wrote a c++ code. when i run it on out put it shows paramater changed > but when i saw the file on my disk there is no change . > so will you see the code and tell me what i'm doing wrong? You should write some additional code that serializes the DOM tree to a file. You can use the DOMLSSerializer class for this as demonstrated in the Xerces-C++ samples. > one more question most of the people say You cant change the xml file > through c++ program or dom parser.Most of them say you have traverse the > whole file and write back it to a new file reach the node where you need > the change and write it to a new file. delete the old file and rename > the new file . > Is it true? if its true Then will you explain me how to do this ? why > cant we change a xml file without writing to a new file ?Is there any > way possible so that we can make changes in xml file without writing it > to a new file ? if there is a way will you explain me how to do this ? You can write a new XML document to an old file, but you'll get a corrupted source file if something going wrong while writing. Good luck! Vitaly From c-userskaitlin41@example.org Thu Apr 07 15:42:01 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 62991 invoked from network); 7 Apr 2011 15:42:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Apr 2011 15:42:01 -0000 Received: (qmail 20958 invoked by uid 500); 7 Apr 2011 15:42:01 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 20906 invoked by uid 500); 7 Apr 2011 15:42:01 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 20898 invoked by uid 99); 7 Apr 2011 15:42:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 15:42:01 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO mailgwout.pragmatics.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 15:41:54 +0000 Received: from pragmail3.pragmatics.com ([83.161.120.155]) by mailgwout.pragmatics.com with Microsoft SMTPSVC508-709-1184); Thu, 7 Apr 2011 11:40:46 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CBF53A.3224B369" Subject: Xerces builds - Why don't they include line number attributes? Date: Thu, 7 Apr 2011 11:40:16 -0400 Message-ID: <kaitlin41@example.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Xerces builds - Why don't they include line number attributes? Thread-Index: Acv1Ohd65LoKT6EzSdOUtBRHX53Zgg== From: "Pieper, Aaron" <kaitlin41@example.org> To: <kaitlin41@example.org> X-OriginalArrivalTime: 07 Apr 2011 15:40:46.0139 (UTC) FILETIME=[296208B0:01CBF53A] ------_=_NextPart_001_01CBF53A.3224B369 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, =20 Is it possible that when building Xerces builds for Java in the future, you could turn the line number attributes on? It makes it easier for developers to set breakpoints and trace through code. Currently, any Java stack traces involving xerces look something like this (with line number information not available): =20 =20 org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(XMLInputSource[]) line: not available =20 =20 org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Source[]) line: not available =20 =20 org.springframework.xml.validation.SchemaLoaderUtils.loadSchema(Resource [], String) line: 73 =20 =20 org.springframework.xml.validation.Jaxp13ValidatorFactory.createValidato r(Resource[], String) line: 40 =20 =20 You can see that the SpringFramework JARs include line numbers, making their code easier to trace; the Xerces JARs do not, which means we can only see the class/method names. The last time I built Xerces, I remember this behavior was already integrated into the Xerces build, but was disabled by default. Not sure if this is by design or simply an oversight. Maybe it should be enabled by default, or maybe whatever process or person builds these final releases could be updated/educated to include this flag? =20 Thanks, =20 - Aaron ------_=_NextPart_001_01CBF53A.3224B369-- From c-userskaitlin41@example.org Thu Apr 07 15:59:00 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 15271 invoked from network); 7 Apr 2011 15:58:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Apr 2011 15:58:59 -0000 Received: (qmail 69413 invoked by uid 500); 7 Apr 2011 15:58:59 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 69385 invoked by uid 500); 7 Apr 2011 15:58:59 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 69375 invoked by uid 99); 7 Apr 2011 15:58:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 15:58:59 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kaitlin41@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e5.ny.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 15:58:50 +0000 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [83.161.120.155]) by e5.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p37FWgbp009385; Thu, 7 Apr 2011 11:32:42 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [83.161.120.155]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 4587538C803C; Thu, 7 Apr 2011 11:58:18 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [83.161.120.155]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p37FwQWt203274; Thu, 7 Apr 2011 11:58:26 -0400 Received: from d01av03.pok.ibm.com (loopback [83.161.120.155]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p37FwQEh019303; Thu, 7 Apr 2011 12:58:26 -0300 Received: from d25ml03.torolab.ibm.com (d25ml03.torolab.ibm.com [83.161.120.155]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p37FwQgu019292; Thu, 7 Apr 2011 12:58:26 -0300 In-Reply-To: <kaitlin41@example.org> References: <kaitlin41@example.org> Subject: Re: Xerces builds - Why don't they include line number attributes? X-KeepSent: 65A1A249:07621833-8525786B:0056F804; type=4; name=$KeepSent To: kaitlin41@example.org Cc: kaitlin41@example.org X-Mailer: Lotus Notes Release 8.0.2FP1 SHF149 July 17, 2009 Message-ID: <kaitlin41@example.org> From: Michael Glavassevich <kaitlin41@example.org> Date: Thu, 7 Apr 2011 11:58:27 -0400 X-MIMETrack: Serialize by Router on D25ML03/25/M/IBM(Release 8.5.1FP5|September 29, 2010) at 04/07/2011 11:58:26 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=0ABBF2F8DFC57E948f9e8a93df938690918c0ABBF2F8DFC57E94" Content-Disposition: inline X-Content-Scanned: Fidelis XPS MAILER X-Virus-Checked: Checked by ClamAV on apache.org --0__=0ABBF2F8DFC57E948f9e8a93df938690918c0ABBF2F8DFC57E94 Content-type: text/plain; charset=US-ASCII Aaron, You picked the wrong mailing list. c-users@ is for Xerces-C. I'm sure you meant to post this to the Java users list. Also, please see previous discussion on this topic in the archives [1]. Thanks. [1] http://markmail.org/thread/qkbaup5dzjrx5ffj Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: kaitlin41@example.org E-mail: kaitlin41@example.org "Pieper, Aaron" <kaitlin41@example.org> wrote on 04/07/2011 11:40:16 AM: > Hello, > > > > Is it possible that when building Xerces builds for Java in the future, > you could turn the line number attributes on? It makes it easier for > developers to set breakpoints and trace through code. Currently, any > Java stack traces involving xerces look something like this (with line > number information not available): > > > > > org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(XMLInputSource[]) > line: not available > > > org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Source[]) > line: not available > > > org.springframework.xml.validation.SchemaLoaderUtils.loadSchema(Resource > [], String) line: 73 > > > org.springframework.xml.validation.Jaxp13ValidatorFactory.createValidato > r(Resource[], String) line: 40 > > > > You can see that the SpringFramework JARs include line numbers, making > their code easier to trace; the Xerces JARs do not, which means we can > only see the class/method names. The last time I built Xerces, I > remember this behavior was already integrated into the Xerces build, but > was disabled by default. Not sure if this is by design or simply an > oversight. Maybe it should be enabled by default, or maybe whatever > process or person builds these final releases could be updated/educated > to include this flag? > > > > Thanks, > > > > - Aaron --0__=0ABBF2F8DFC57E948f9e8a93df938690918c0ABBF2F8DFC57E94-- From c-userskaitlin41@example.org Thu Apr 07 16:07:04 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 68531 invoked from network); 7 Apr 2011 16:07:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Apr 2011 16:07:04 -0000 Received: (qmail 81378 invoked by uid 500); 7 Apr 2011 16:07:03 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 81354 invoked by uid 500); 7 Apr 2011 16:07:03 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 81346 invoked by uid 99); 7 Apr 2011 16:07:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 16:07:03 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO mailgwout.pragmatics.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 16:06:59 +0000 Received: from pragmail3.pragmatics.com ([83.161.120.155]) by mailgwout.pragmatics.com with Microsoft SMTPSVC508-709-1184); Thu, 7 Apr 2011 12:05:50 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Xerces builds - Why don't they include line number attributes? Date: Thu, 7 Apr 2011 12:00:20 -0400 Message-ID: <kaitlin41@example.org> In-Reply-To: <kaitlin41@example.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Xerces builds - Why don't they include line number attributes? Thread-Index: Acv1PLd6q9RySjd6Td+xuUco9efgYwAACZrg References: <kaitlin41@example.org> <kaitlin41@example.org> From: "Pieper, Aaron" <kaitlin41@example.org> To: <kaitlin41@example.org> X-OriginalArrivalTime: 07 Apr 2011 16:05:50.0598 (UTC) FILETIME=[AA1C4260:01CBF53D] My mistake, thanks for your patience. - Aaron -----Original Message----- From: Michael Glavassevich [mailto:kaitlin41@example.org]=20 Sent: Thursday, April 07, 2011 11:58 AM To: kaitlin41@example.org Cc: kaitlin41@example.org Subject: Re: Xerces builds - Why don't they include line number attributes? Aaron, You picked the wrong mailing list. c-users@ is for Xerces-C. I'm sure you meant to post this to the Java users list. Also, please see previous discussion on this topic in the archives [1]. Thanks. [1] http://markmail.org/thread/qkbaup5dzjrx5ffj Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: kaitlin41@example.org E-mail: kaitlin41@example.org "Pieper, Aaron" <kaitlin41@example.org> wrote on 04/07/2011 11:40:16 AM: > Hello, > > > > Is it possible that when building Xerces builds for Java in the future, > you could turn the line number attributes on? It makes it easier for > developers to set breakpoints and trace through code. Currently, any > Java stack traces involving xerces look something like this (with line > number information not available): > > > > > org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(XMLInputSource[]) > line: not available > > > org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Source[]) > line: not available > > > org.springframework.xml.validation.SchemaLoaderUtils.loadSchema(Resource > [], String) line: 73 > > > org.springframework.xml.validation.Jaxp13ValidatorFactory.createValidato > r(Resource[], String) line: 40 > > > > You can see that the SpringFramework JARs include line numbers, making > their code easier to trace; the Xerces JARs do not, which means we can > only see the class/method names. The last time I built Xerces, I > remember this behavior was already integrated into the Xerces build, but > was disabled by default. Not sure if this is by design or simply an > oversight. Maybe it should be enabled by default, or maybe whatever > process or person builds these final releases could be updated/educated > to include this flag? > > > > Thanks, > > > > - Aaron From c-userskaitlin41@example.org Tue Apr 12 12:10:35 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 23206 invoked from network); 12 Apr 2011 12:10:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Apr 2011 12:10:35 -0000 Received: (qmail 76493 invoked by uid 500); 12 Apr 2011 12:10:35 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 76440 invoked by uid 500); 12 Apr 2011 12:10:34 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 76432 invoked by uid 99); 12 Apr 2011 12:10:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 12:10:34 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kaitlin41@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO lo.gmane.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 12:10:28 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from <kaitlin41@example.org>) id 1Q9cQ0-0004Qy-TH for kaitlin41@example.org; Tue, 12 Apr 2011 14:10:04 +0200 Received: from adsl-ull-8-88.41-151.net24.it ([83.161.120.155]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for <kaitlin41@example.org>; Tue, 12 Apr 2011 14:10:04 +0200 Received: from raffaelemoles by adsl-ull-8-88.41-151.net24.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for <kaitlin41@example.org>; Tue, 12 Apr 2011 14:10:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: kaitlin41@example.org From: Raffaele <kaitlin41@example.org> Subject: Problem with XSComplexTypeDefinition Date: Tue, 12 Apr 2011 14:03:35 +0200 Lines: 89 Message-ID: <op.vttqf9ki8fuhek@raffa> Reply-To: kaitlin41@example.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: kaitlin41@example.org X-Gmane-NNTP-Posting-Host: adsl-ull-8-88.41-151.net24.it User-Agent: Opera Mail/11.01 (Win32) Good morning, I'm using Xerces-c-3.1.1 built as a static library on mingw/msys on Windows Vista. I succeed on loading a schema grammar from a file and I can list the schema components but I get the following behaviour: 1) SCHEMA In the schema there are global element and attribute declarations as well as their types: - the (attribute) simple type definition: <xs:simpleType name="int_0_100_t"> <xs:restriction base="xs:int"> <xs:minInclusive value="0"/> <xs:maxInclusive value="100"/> </xs:restriction> </xs:simpleType> - the attribute declaration: <xs:attribute name="attr_int_0_100" type="int_0_100_t"/> - the (element) complex type definition: <xs:complexType name="elem_int_t"> <xs:attribute ref="attr_int_0_100"/> </xs:complexType> - the element declaration: <xs:element name="elem_int" type="elem_int_t"/> 2) C++ XMLGrammarPool *pool = new XMLGrammarPoolImpl(); XercesDOMParser *parser = new XercesDOMParser(0, XMLPlatformUtils888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4gMemoryManager, pool); //load the schema grammar parser->loadGrammar("test.xsd", Grammar888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SchemaGrammarType, true); //get the schema's target namespace XSNamespaceItem *namespaceItem = model->getNamespaceItem(grammar->getTargetNamespace()); //NB. the function LocToUniString converts const char* to const XMLCh* //STEP 1: get the global complex type definition from the namespace XSTypeDefinition *t1 = namespaceItem->getTypeDefinition(LocToUniString("elem_int_t")); XSComplexTypeDefinition *d1 = static_cast<XSComplexTypeDefinition*>(t1); st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cout << "\nName: " << d1->getName() << "\nAttributeUses: " << d1->getAttributeUses(); OUTPUT: Name: elem_int_t CORRECT AttributeUses: 0 WRONG //STEP 2: get the global complex type definition from the element declaration XSElementDeclaration *e = namespaceItem->getElementDeclaration(LocToUniString("elem_int"); XSTypeDefinition *t2 = e->getTypeDefinition(); XSComplexTypeDefinition *d2 = static_cast<XSComplexTypeDefinition*>(t2); st888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cout << "\nName: " << d2->getName() << "\nAttributeUses: " << d2->getAttributeUses(); OUTPUT: Name: anyType WRONG AttributeUses: 0 WRONG and also: d1 != d2 (as pointers) Please, note that doing the same for global attributes I get correct output; i.e. XSSimpleTypeDefinition works fine. Any idea? Thanks a lot Raffaele -- Using Opera's revolutionary email client: http://www.opera.com/mail/ From c-userskaitlin41@example.org Tue Apr 12 18:10:50 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 27696 invoked from network); 12 Apr 2011 18:10:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Apr 2011 18:10:50 -0000 Received: (qmail 16107 invoked by uid 500); 12 Apr 2011 18:10:50 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 16081 invoked by uid 500); 12 Apr 2011 18:10:50 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 16073 invoked by uid 99); 12 Apr 2011 18:10:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 18:10:50 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kaitlin41@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO smtpmail.sensis.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 18:10:43 +0000 Received: from dimstar3.ats.sensis.com ([83.161.120.155]) by smtpmail.sensis.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <kaitlin41@example.org>) id 1Q9i2h-0003PS-47 for kaitlin41@example.org; Tue, 12 Apr 2011 14:10:23 -0400 Received: from corpatsmail4.ats.sensis.com ([83.161.120.155] helo=corpatsmail4.corp.sensis.com) by dimstar3.ats.sensis.com with esmtp (Exim 4.69) (envelope-from <kaitlin41@example.org>) id 1Q9i1W-0002N9-I9 for kaitlin41@example.org; Tue, 12 Apr 2011 14:09:10 -0400 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4721 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CBF93C.AECA79A0" Subject: Xerces link warning Date: Tue, 12 Apr 2011 14:08:52 -0400 Message-ID: <kaitlin41@example.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Xerces link warning thread-index: Acv4gZ3FzhwqEXDUTJuRM7MMBuleVAAuv7Uw From: "Kapoor, Nitin" <kaitlin41@example.org> To: "Kapoor, Nitin" <kaitlin41@example.org>, <kaitlin41@example.org> X-Sensis-MailScanner-Information: Scanned at Sensis Corporation by MailScanner X-Sensis-MailScanner-ID: 1Q9i1W-0002N9-I9 X-Sensis-MailScanner: Found to be clean X-Sensis-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (not cached, score=-2.928, required 5, autolearn=not spam, ALL_TRUSTED -1.00, AWL -0.02, BAYES_00 -1.90, HTML_MESSAGE 0.00, T_RP_MATCHES_RCVD -0.01) X-Sensis-MailScanner-From: kaitlin41@example.org ------_=_NextPart_001_01CBF93C.AECA79A0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Folks, =20 I am trying to compile xerces and getting the following warning: =20 libtool: link: g++ -g -O2 -D_REENTRANT -pthreads -o .libs/EnumVal src/EnumVal/EnumVal.o ../src/.libs/libxerces-c.so /usr/sfw/lib/libstdc++.so -L/usr/sfw/lib -lnsl -lsocket -licuuc -licudata -pthreads -Wl,-R -Wl,/usr/local/lib -Wl,-R -Wl,/usr/sfw/lib ld: warning: file /usr/sfw/lib/libstdc++.so: attempted multiple inclusion of file =20 =20 Info about the system:- =20 -bash-3.00$ uname -a SunOS sunshot 5.10 Generic_142909-17 sun4v sparc SUNW,T5140 =20 =20 -bash-3.00$ gcc --v Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs Configured with: /sfw10/builds/build/sfw10-patch/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=3D/usr/sfw --with-as=3D/usr/ccs/bin/as --without-gnu-as --with-ld=3D/usr/ccs/bin/ld --without-gnu-ld --enable-languages=3Dc,c++ --enable-shared Thread model: posix gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath) =20 Thanks, =20 NitinK. =20 - This message is intended only for the addressee and may contain = information that is company confidential or privileged. Any technical = data in this message may be exported only in accordance with the U.S. = International Traffic in Arms Regulations (22 CFR Parts 120-130) or the = Export Administration Regulations (15 CFR Parts 730-774). Unauthorized = use is strictly prohibited and may be unlawful. If you are not the = intended recipient, or the person responsible for delivering to the = intended recipient, you should not read, copy, disclose or otherwise use = this message. If you have received this email in error, please delete = it, and advise the sender immediately.=20 - = = = =20 ------_=_NextPart_001_01CBF93C.AECA79A0-- From c-userskaitlin41@example.org Wed Apr 13 18:51:04 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 15634 invoked from network); 13 Apr 2011 18:51:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 13 Apr 2011 18:51:04 -0000 Received: (qmail 66702 invoked by uid 500); 13 Apr 2011 18:51:04 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 66672 invoked by uid 500); 13 Apr 2011 18:51:04 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 66664 invoked by uid 99); 13 Apr 2011 18:51:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Apr 2011 18:51:04 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kaitlin41@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO NY1MX1.mail.appsecinc.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Apr 2011 18:50:59 +0000 Received: from mxe1.nycapt35k.com (83.161.120.155) by NY1MX1.mail.appsecinc.com (83.161.120.155) with Microsoft SMTP Server (TLS) id 8.1.393.1; Wed, 13 Apr 2011 14:50:55 -0400 Received: from mxe1.nycapt35k.com ([83.161.120.155]) by mxe1 ([83.161.120.155]) with mapi; Wed, 13 Apr 2011 14:50:38 -0400 From: Philip Montrowe <kaitlin41@example.org> To: "kaitlin41@example.org" <kaitlin41@example.org> Date: Wed, 13 Apr 2011 14:50:36 -0400 Subject: 3.1.1 xercesc_3_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4EndOfEntityException from install tests Thread-Topic: 3.1.1 xercesc_3_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4EndOfEntityException from install tests Thread-Index: Acv6CvMZD48/EieYSO6LaKEIHQj/AA== Message-ID: <B123726B195B6C4C99D665E7C50C7C9A08F45E6FA7@mxe1> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_B123726B195B6C4C99D665E7C50C7C9A08F45E6FA7mxe1_" MIME-Version: 1.0 --_000_B123726B195B6C4C99D665E7C50C7C9A08F45E6FA7mxe1_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable We are in the process of trying to upgrade to Xerces 3.1.1 from Xerces 2.7.= 0. We have a problem building/testing on Solaris 2.9 with gcc 4.5.2 (for 2.7.0= we used suncc) My configure looks like this: ../configure \ --prefix=3D"instPath" \ --enable-static \ --disable-shared \ --disable-debug \ --disable-acexml \ --disable-qos \ --disable-ace-examples \ --with-openssl=3D"sslPath" \ LIBS=3D"-ldl -laio" This builds ok but running the tests as follows fails: cp ../tests/run* tests ( cd tests; perl -I ../../bin run_test.pl ) Previously our tests ran successfully this way on 2.7.0 and they also run s= uccessfully for 3.1.1 on other platforms like Linux. The errors we receive are: rm -f test-results.log export PATH=3D/srcspace/pmontrow/Thirdparty/unix/source/xerces-c-3.1.1/samp= les:/srcspace/pmontrow/Thirdparty/unix/source/xerces-c-3.1.1/tests:"/usr/lo= cal/bin:/usr/bin:/bin:/usr/sbin:/usr/ccs/bin" && export XERCESC_NLS_HOME=3D= /srcspace/pmontrow/Thirdparty/unix/source/xerces-c-3.1.1/src/.libs && cd . = && perl scripts/sanityTest.pl 2>&1 | /usr/bin/sed 's/ *[0-9][0-9]* *ms */{= timing removed}/' 1> /srcspace/pmontrow/Thirdparty/unix/source/xerces-c-3.1= .1/test-results.log diff test-results.log ./scripts/sanityTest_ExpectedResult.log 21,22c21,22 < terminate called after throwing an instance of 'xercesc_3_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4EndOfEntityE= xception' < terminate called after throwing an instance of 'xercesc_3_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4EndOfEntityE= xception' --- > personal.xml:{timing removed}(37 elems, 12 attrs, 0 spaces, 268 chars) > personal.xml:{timing removed}(37 elems, 12 attrs, 134 spaces, 134 chars) 48,51c48,125 < terminate called after throwing an instance of 'xercesc_3_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4EndOfEntityE= xception' < <?xml version=3D"1.0" encoding=3D"LATIN1"?> < terminate called after throwing an instance of 'xercesc_3_888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4EndOfEntityE= xception' < <?xml version=3D"1.0" encoding=3D"LATIN1"?> --- > <personnel> > > <person id=3D"Big.Boss"> > <name><family>Boss</family> <given>Big</given></name> > <email>kaitlin41@example.org</email> > <link subordinates=3D"one.worker two.worker three.worker four.worker = five.worker"></link> > </person> > > <person id=3D"one.worker"> > <name><family>Worker</family> <given>One</given></name> > <email>kaitlin41@example.org</email> > <link manager=3D"Big.Boss"></link> > </person> > There's many more lines of diff, the essential problem is everything termin= ates with this EndOfEntityException. Any thoughts appreciated. Philip --_000_B123726B195B6C4C99D665E7C50C7C9A08F45E6FA7mxe1_-- From c-userskaitlin41@example.org Thu Apr 14 15:56:48 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 44290 invoked from network); 14 Apr 2011 15:56:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Apr 2011 15:56:48 -0000 Received: (qmail 16679 invoked by uid 500); 14 Apr 2011 15:56:47 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 16621 invoked by uid 500); 14 Apr 2011 15:56:47 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 16613 invoked by uid 99); 14 Apr 2011 15:56:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Apr 2011 15:56:47 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kaitlin41@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-yi0-f51.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Apr 2011 15:56:42 +0000 Received: by yib2 with SMTP id 2so1004702yib.38 for <kaitlin41@example.org>; Thu, 14 Apr 2011 08:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=M2doVI2/DmvUZRs+nC7cgSTqKPahzmbRsCtB1/o90ak=; b=DAGSDlRgHEFgQk7NSW8Lorp5eJH7srdqBMNdQ2NVdg8qZzGVGFkTvTyU3cxoP7Iu/t CSeDM25ixNP33WkDV0dtqvk68MeDfkux0ViuwWQ9vNZPsUiRwgDLqQ1hqBuBIVzG5+J3 t2vFGz+SdgMydL8Ra6PNW6E/Lqvfku0z3eDnQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=NyI1+gzjhSoLf//qHuwIhs68NqhfW84mLeAtfxIIoYM7qx19OzK6CCRQmZZ7XKtm8l N+aAihBSlsxtFskRzZYl8eSQYvU41DtEKBiXjBvE5uyQ75M+9nG3mEp0hx45xhWoRHbn 7THZ9+zgn5w0ZgGKjI9Mbf478cjp7JfKNc+8M= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id eu18mr1322914icb.495.1302796581332; Thu, 14 Apr 2011 08:56:21 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Thu, 14 Apr 2011 08:56:21 -0700 (PDT) Date: Thu, 14 Apr 2011 17:56:21 +0200 Message-ID: <kaitlin41@example.org> Subject: Bug in Xerces? From: Robert Wermuth <kaitlin41@example.org> To: kaitlin41@example.org Content-Type: multipart/alternative; boundary=20cf30223db171e6f504a0e2f7d1 --20cf30223db171e6f504a0e2f7d1 Content-Type: text/plain; charset=ISO-8859-1 Hello, I am using xerces 3.1.1 with the SAX2XMLReader. I use pParser->setEntityResolver() to install my own entity resolver. I compile my project with Visual Studio c++ 9.1 (using the static xerces libs). But in the Release build my program crashes on pParser->parseFirst() when I set my entity resolver.I tried to compile the example code shown there: http://xerces.apache.org/xerces-c/apiDocs-3/classXMLEntityResolver.html. But I get a compiler error (XMLResourceIdentifier888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SystemId is not defined.). Is there an error in the lib? Greetings Robert --20cf30223db171e6f504a0e2f7d1-- From c-userskaitlin41@example.org Thu Apr 14 19:46:54 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 34302 invoked from network); 14 Apr 2011 19:46:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 14 Apr 2011 19:46:54 -0000 Received: (qmail 84761 invoked by uid 500); 14 Apr 2011 19:46:54 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 84745 invoked by uid 500); 14 Apr 2011 19:46:54 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 84737 invoked by uid 99); 14 Apr 2011 19:46:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Apr 2011 19:46:54 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO ntmamx2.progress.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Apr 2011 19:46:47 +0000 Received: from ntmamx2.progress.com (83.161.120.155) by ntmamx2.progress.com (MlfMTA v3.2r9) id hkt7i20171sk for <kaitlin41@example.org>; Thu, 14 Apr 2011 15:46:20 -0400 (envelope-from <kaitlin41@example.org>) Received: from progress.com ([83.161.120.155]) by ntmamx2.progress.com (SonicWALL 83.161.120.15583) with ESMTP (AIO); Thu, 14 Apr 2011 15:46:20 -0400 Received: from NTMAEXCAS02.bedford.progress.com (ntmaexcas02 [83.161.120.155]) by progress.com (8.13.8/8.13.8) with ESMTP id p3EJkQng019579 for <kaitlin41@example.org>; Thu, 14 Apr 2011 15:46:26 -0400 (EDT) Received: from [83.161.120.155] (83.161.120.155) by NTMAEXCAS02.bedford.progress.com (83.161.120.155) with Microsoft SMTP Server (TLS) id 83.161.120.155; Thu, 14 Apr 2011 15:46:26 -0400 Message-ID: <kaitlin41@example.org> Date: Thu, 14 Apr 2011 21:46:23 +0200 From: Alberto Massari <kaitlin41@example.org> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; it; rv:83.161.120.155) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: <kaitlin41@example.org> Subject: Re: Bug in Xerces? References: <kaitlin41@example.org> In-Reply-To: <kaitlin41@example.org> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-EMS-Proccessed: +CmIlJ+kdV7Z341JADFd9w== X-EMS-STAMP: TVExuHl4RvapWozWNgQE5A== X-Mlf-Version: 83.161.120.15583 X-Mlf-UniqueId: o201104141946200243946 Hi Robert, it's hard to tell what's wrong without seeing your code. I would guess you are allocating an object on the stack that is destroyed before the parsing take place... Could you share the code you are using? Alberto Il 14/04/2011 17:56, Robert Wermuth ha scritto: > Hello, > I am using xerces 3.1.1 with the SAX2XMLReader. I use > pParser->setEntityResolver() to install my own entity resolver. I compile my > project with Visual Studio c++ 9.1 (using the static xerces libs). But in > the Release build my program crashes on pParser->parseFirst() when I set my > entity resolver.I tried to compile the example code shown there: > http://xerces.apache.org/xerces-c/apiDocs-3/classXMLEntityResolver.html. But > I get a compiler error (XMLResourceIdentifier888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SystemId is not defined.). Is > there an error in the lib? > > Greetings > Robert > From c-userskaitlin41@example.org Fri Apr 15 08:38:20 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 44231 invoked from network); 15 Apr 2011 08:34:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 15 Apr 2011 08:34:13 -0000 Received: (qmail 78777 invoked by uid 500); 15 Apr 2011 08:34:13 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 78764 invoked by uid 500); 15 Apr 2011 08:34:12 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 77640 invoked by uid 99); 15 Apr 2011 08:34:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2011 08:34:09 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kaitlin41@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-iy0-f179.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2011 08:34:04 +0000 Received: by iym7 with SMTP id 7so2569153iym.38 for <kaitlin41@example.org>; Fri, 15 Apr 2011 01:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=oGwkHhGzht64NUPxSNhQvzwQiqGeq7dW4QW42VmveRg=; b=CqLisycIdPpgHnyJLt83j+ChwLQcA2CrLUoEoPTjqZINUyAZmRVD9PBwA78rAE9v4l RMBgFBG9JDYV78FQFH3UR/WSlp7WfohbeTNliKQM+4vMPuqX94gbl2Q7KCYQrbY0RuSi 7jf22L/UXxf/TiGoki8tupMjQIJnchXc9QUGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Hz6Tv3CpmDMmfT2Oa/FmpH68jlUQK8pre56eKrVzfkQCIyUsQeRj2O+j23p2zIXqSG SAGnlSmqYvhAqzSZRBvH960MyoMKZMzzGVbKAdgNmQQtn4p3EK0XUs0D4CRVR9QjLvTN nNN1OC9B8Tshnttw0MEVqZ1hQL0hQuvoMqock= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id eu18mr2494232icb.495.1302856423527; Fri, 15 Apr 2011 01:33:43 -0700 (PDT) Received: by 83.161.120.155 with HTTP; Fri, 15 Apr 2011 01:33:43 -0700 (PDT) In-Reply-To: <kaitlin41@example.org> References: <kaitlin41@example.org> <kaitlin41@example.org> Date: Fri, 15 Apr 2011 10:33:43 +0200 Message-ID: <kaitlin41@example.org> Subject: Re: Bug in Xerces? From: Robert Wermuth <kaitlin41@example.org> To: kaitlin41@example.org Content-Type: multipart/alternative; boundary=20cf30223db151569b04a0f0e6f9 --20cf30223db151569b04a0f0e6f9 Content-Type: text/plain; charset=ISO-8859-1 Hi Alberto, at first thanks for your fast answer. I am using stack objects, but I starts the parsing in an child stackframe, so that the stackobjects should be kaitlin41@example.org. The program runs in debug build well, but in the release build it crashes. I found out that it crashes at XMLString888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4replicate() (called by RegxParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4parse()) at the memcpy()-function. The program don't crashes if I remove my own entity resolver. Here is some code of my program for you: Here is my entity resolver: class MyEntityResolver : public XMLEntityResolver { public: virtual ~MyEntityResolver() { } MyEntityResolver() { } virtual InputSource *resolveEntity(XMLResourceIdentifier *resourceIdentifier) { //this prozedure get fired one time, but all the pointers are invalid (I made them public for reading them) printf("BaseURI: 0x%08X\nLocator: 0x%08X\nNameSpace: 0x%08X\nPublicId: 0x%08X\nResourceIdentifierType: 0x%08X\n" "SystemId: 0x%08X" , (UINT) resourceIdentifier->fBaseURI, (UINT) resourceIdentifier->fLocator, (UINT) resourceIdentifier->fNameSpace, (UINT) resourceIdentifier->fPublicId, (UINT) resourceIdentifier->fResourceIdentifierType, (UINT) resourceIdentifier->fSystemId); return g_pMemBufSourceForDTD; } }; And here is the code for parsing the XML-file: SAX2XMLReader* pParser = XMLReaderFactory888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4reateXMLReader(); XMLPScanToken Token; MyDocumentHandler XmlHandler; MemoryManagerImpl MemManager; void * pDestXMLData; Grammar * pGrammar; pDestXMLData = MemManager.allocate(p_nSize); memcpy(pDestXMLData, p_pXMLData, p_nSize); MemBufInputSource MemBufSource( (const XMLByte *) pDestXMLData, p_nSize, "Fake sytem ID", FALSE, &MemManager); pParser->setContentHandler(&XmlHandler); MyErrorHandler XmlErrorHandler; pParser->setErrorHandler(&XmlErrorHandler); MyEntityResolver XmlEntityResolver; pParser->setEntityResolver((EntityResolver *const) &XmlEntityResolver); pGrammar = pParser->loadGrammar( *g_pMemBufSourceForDTD, Grammar888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4TDGrammarType, TRUE); pParser->setFeature(XMLUni888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4gXercesUseCachedGrammarInParse, TRUE); pParser->setFeature(XMLUni888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4gXercesSchemaFullChecking, TRUE); pParser->setFeature(XMLUni888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4gSAX2CoreValidation, TRUE); pParser->setFeature(XMLUni888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4gXercesSkipDTDValidation, FALSE); pParser->setFeature(XMLUni888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4gXercesLoadExternalDTD, TRUE); pParser->setFeature(XMLUni888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4gXercesDynamic, TRUE); try { if(!pParser->parseFirst(MemBufSource, Token)) //Here is the crash! { goto ParseError; } while(pParser->parseNext(Token)) { if(g_bParseError == TRUE) { MemManager.deallocate(pDestXMLData); delete pParser; return FALSE; } } } Is that all you need? Greetings Robert 2011/4/14 Alberto Massari <kaitlin41@example.org> Hi Robert, it's hard to tell what's wrong without seeing your code. I would guess you are allocating an object on the stack that is destroyed before the parsing take place... Could you share the code you are using? Alberto Il 14/04/2011 17:56, Robert Wermuth ha scritto: Hello, I am using xerces 3.1.1 with the SAX2XMLReader. I use pParser->setEntityResolver() to install my own entity resolver. I compile my project with Visual Studio c++ 9.1 (using the static xerces libs). But in the Release build my program crashes on pParser->parseFirst() when I set my entity resolver.I tried to compile the example code shown there: http://xerces.apache.org/xerces-c/apiDocs-3/classXMLEntityResolver.html. But I get a compiler error (XMLResourceIdentifier888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4SystemId is not defined.). Is there an error in the lib? Greetings Robert > > >> >> --20cf30223db151569b04a0f0e6f9-- From c-userskaitlin41@example.org Fri Apr 15 08:52:42 2011 Return-Path: <c-userskaitlin41@example.org> Delivered-To: kaitlin41@example.org Received: (qmail 24119 invoked from network); 15 Apr 2011 08:52:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 15 Apr 2011 08:52:42 -0000 Received: (qmail 95578 invoked by uid 500); 15 Apr 2011 08:52:41 -0000 Delivered-To: kaitlin41@example.org Received: (qmail 95362 invoked by uid 500); 15 Apr 2011 08:52:31 -0000 Mailing-List: contact kaitlin41@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:kaitlin41@example.org> List-Unsubscribe: <mailto:kaitlin41@example.org> List-Post: <mailto:kaitlin41@example.org> List-Id: <c-users.xerces.apache.org> Reply-To: kaitlin41@example.org Delivered-To: mailing list kaitlin41@example.org Received: (qmail 95337 invoked by uid 99); 15 Apr 2011 08:52:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2011 08:52:29 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO ntmamx2.progress.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2011 08:52:22 +0000 Received: from ntmamx2.progress.com (83.161.120.155) by ntmamx2.progress.com (MlfMTA v3.2r9) id hl03kc0171s4 for <kaitlin41@example.org>; Fri, 15 Apr 2011 04:52:02 -0400 (envelope-from <kaitlin41@example.org>) Received: from progress.com ([83.161.120.155]) by ntmamx2.progress.com (SonicWALL 83.161.120.15583) with ESMTP (AIO); Fri, 15 Apr 2011 04:52:02 -0400 Received: from NTMAEXCAS02.bedford.progress.com (ntmaexcas02-lb [83.161.120.155]) by progress.com (8.13.8/8.13.8) with ESMTP id p3F8q2kU022605 for <kaitlin41@example.org>; Fri, 15 Apr 2011 04:52:02 -0400 (EDT) Received: from [83.161.120.155] (83.161.120.155) by NTMAEXCAS02.bedford.progress.com (83.161.120.155) with Microsoft SMTP Server (TLS) id 83.161.120.155; Fri, 15 Apr 2011 04:52:01 -0400 Message-ID: <kaitlin41@example.org> Date: Fri, 15 Apr 2011 10:51:56 +0200 From: Alberto Massari <kaitlin41@example.org> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; it; rv:83.161.120.155) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: <kaitlin41@example.org> Subject: Re: Bug in Xerces? References: <kaitlin41@example.org> <kaitlin41@example.org> <kaitlin41@example.org> In-Reply-To: <kaitlin41@example.org> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-EMS-Proccessed: +CmIlJ+kdV7Z341JADFd9w== X-EMS-STAMP: 9YCcV+r9xbIHVPwX2KUPYQ== X-Mlf-Version: 83.161.120.15583 X-Mlf-UniqueId: o201104150852020229425 X-Virus-Checked: Checked by ClamAV on apache.org Hi Robert, you are creating an XMLEntityResolver, but using the setEntityResolver API that expects an EntityResolver interface; infact, you had to add a cast to force
{'source': 'Apache Software Foundation Public Mail Archives'}