http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Xerces Project

Overview
Charter
Release Info
Advisories
Download

Xerces-C++ 3.1.4
Installation
Build Instructions

Programming
Samples
FAQs

API Reference
DOM C++ Binding
Migration Guide

Feedback
Bug-Reporting
Mailing Lists

Source Repository
Applications

StdInParse
 

StdInParse demonstrates streaming XML data from standard input.

Running StdInParse
 

The StdInParse sample parses an XML file from standard input and prints out the number of elements in the file. To run StdInParse, enter the following:

StdInParse < <XML file>

The following parameters may be set from the command line

Usage:
    StdInParse [options] < <XML file>

This program demonstrates streaming XML data from standard
input.  It then uses the SAX Parser, and prints the
number of elements, attributes, spaces and characters found
in the input, using SAX API.

Options:
    -v=xxx      Validation scheme [always | never | auto*].
    -n          Enable namespace processing. Defaults to off.
    -s          Enable schema processing. Defaults to off.
    -f          Enable full schema constraint checking. Defaults to off.
    -?          Show this help.

  * = Default if not provided explicitly.

-v=always will force validation
-v=never will not use any validation
-v=auto will validate if a DOCTYPE declaration or a schema declaration is present in the XML document

Make sure that you run StdInParse in the samples/data directory.

Here is a sample output from StdInParse:

cd xerces-c-3.1.4/samples/data
StdInParse -v=always < personal.xml
stdin: 10 ms (37 elems, 12 attrs, 0 spaces, 268 chars)

Running StdInParse with the validating parser gives a different result because ignorable white-space is counted separately from regular characters.

StdInParse -v=never < personal.xml
stdin: 10 ms (37 elems, 12 attrs, 0 spaces, 268 chars)

Note that the sum of spaces and characters in both versions is the same.

NoteThe time reported by the program may be different depending on your processor speed.



Copyright © 1999-2015 The Apache Software Foundation. All Rights Reserved.