Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 


 ПОДПИСКА

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.




Xerces-C Sample 5: MemParse

MemParse

MemParse uses the Validating SAX Parser to parse a memory buffer containing XML statements, and reports the number of elements and attributes found.

Building on Windows

Load the xerces-c1_4_0-win32\samples\Projects\Win32\VC6\samples.dsw Microsoft Visual C++ workspace inside your MSVC IDE. Then build the project marked MemParse.

Building on UNIX

cd xerces-c1_4_0-linux/samples
./runConfigure -p<platform> -c<C_compiler> -x<C++_compiler>
cd MemParse
gmake

This will create the object files in the current directory and the executable named MemParse in 'xerces-c1_4_0-linux/bin' directory.

To delete all the generated object files and executables, type

gmake clean

Running MemParse

This program uses the SAX Parser to parse a memory buffer containing XML statements, and reports the number of elements and attributes found.

MemParse [-v]

The -v option is used to invoke the Validating SAX Parser instead. When invoked with a validating parser:

cd xerces-c1_4_0-linux/samples/data
MemParse -v

The output is the following:

Finished parsing the memory buffer containing
the following XML statements:

<?xml version='1.0' encoding='ascii'?>
<!DOCTYPE company [
<!ELEMENT company     (product,category,developedAt)>
<!ELEMENT product     (#PCDATA)>
<!ELEMENT category    (#PCDATA)>
<!ATTLIST category idea CDATA #IMPLIED>
<!ELEMENT developedAt (#PCDATA)>
]>

<company>
  <product>Xerces-C</product>
  <category idea='great'>XML Parsing Tools</category>
  <developedAt>
    IBM Center for Java Technology, Silicon Valley, Cupertino, CA
  </developedAt>
</company>

Parsing took 0 ms (4 elements, 1 attributes,
16 spaces, 95 characters).

Copyright © 2000 The Apache Software Foundation. All Rights Reserved.



With any suggestions or questions please feel free to contact us