You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
3.0 KiB

  1. <?xml version="1.0" standalone="no"?>
  2. <!--
  3. * Licensed to the Apache Software Foundation (ASF) under one or more
  4. * contributor license agreements. See the NOTICE file distributed with
  5. * this work for additional information regarding copyright ownership.
  6. * The ASF licenses this file to You under the Apache License, Version 2.0
  7. * (the "License"); you may not use this file except in compliance with
  8. * the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. -->
  18. <!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">
  19. <s1 title="Sample: StdInParse">
  20. <s2 title="StdInParse">
  21. <p>StdInParse demonstrates streaming XML data from standard input.</p>
  22. <s3 title="Running StdInParse">
  23. <p>The StdInParse sample parses an XML file from standard input and prints out
  24. the number of
  25. elements in the file. To run StdInParse, enter the following: </p>
  26. <source>StdInParse &lt; &lt;XML file&gt;</source>
  27. <p>The following parameters may be set from the command line </p>
  28. <source>
  29. Usage:
  30. StdInParse [options] &lt; &lt;XML file&gt;
  31. This program demonstrates streaming XML data from standard
  32. input. It then uses the SAX Parser, and prints the
  33. number of elements, attributes, spaces and characters found
  34. in the input, using SAX API.
  35. Options:
  36. -v=xxx Validation scheme [always | never | auto*].
  37. -n Enable namespace processing. Defaults to off.
  38. -s Enable schema processing. Defaults to off.
  39. -f Enable full schema constraint checking. Defaults to off.
  40. -? Show this help.
  41. * = Default if not provided explicitly.
  42. </source>
  43. <p><em>-v=always</em> will force validation<br/>
  44. <em>-v=never</em> will not use any validation<br/>
  45. <em>-v=auto</em> will validate if a DOCTYPE declaration or a schema declaration is present in the XML document</p>
  46. <p>Make sure that you run StdInParse in the samples/data directory.</p>
  47. <p>Here is a sample output from StdInParse:</p>
  48. <source>cd &XercesC3InstallDir;/samples/data
  49. StdInParse -v=always &lt; personal.xml
  50. stdin: 10 ms (37 elems, 12 attrs, 0 spaces, 268 chars)</source>
  51. <p>Running StdInParse with the validating parser gives a different result because
  52. ignorable white-space is counted separately from regular characters.</p>
  53. <source>StdInParse -v=never &lt; personal.xml
  54. stdin: 10 ms (37 elems, 12 attrs, 0 spaces, 268 chars)</source>
  55. <p>Note that the sum of spaces and characters in both versions is the same.</p>
  56. <note>The time reported by the program may be different depending on your
  57. processor speed.</note>
  58. </s3>
  59. </s2>
  60. </s1>