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.

66 lines
2.8 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: DOMCount">
  20. <s2 title="DOMCount">
  21. <p>DOMCount uses the provided DOM API to parse an XML file,
  22. construct the DOM tree and walk through the tree counting
  23. the elements (using just one API call).</p>
  24. <s3 title="Running DOMCount">
  25. <p>The DOMCount sample parses an XML file and prints out the number of
  26. elements in the file. To run DOMCount, enter the following </p>
  27. <source>DOMCount &lt;XML file&gt;</source>
  28. <p>The following parameters may be set from the command line </p>
  29. <source>
  30. Usage:
  31. DOMCount [options] &lt;XML file | List file&gt;
  32. This program invokes the DOMLSParser, builds the DOM tree,
  33. and then prints the number of elements found in each XML file.
  34. Options:
  35. -l Indicate the input file is a List File that has a list of xml files.
  36. Default to off (Input file is an XML file).
  37. -v=xxx Validation scheme [always | never | auto*].
  38. -n Enable namespace processing. Defaults to off.
  39. -s Enable schema processing. Defaults to off.
  40. -f Enable full schema constraint checking. Defaults to off.
  41. -locale=ll_CC specify the locale, default: en_US
  42. -p Print out names of elements and attributes encountered.
  43. -? Show this help.
  44. * = Default if not provided explicitly.
  45. </source>
  46. <p><em>-v=always</em> will force validation<br/>
  47. <em>-v=never</em> will not use any validation<br/>
  48. <em>-v=auto</em> will validate if a DOCTYPE declaration or a schema declaration is present in the XML document</p>
  49. <p>Here is a sample output from DOMCount</p>
  50. <source>cd &XercesC3InstallDir;/samples/data
  51. DOMCount -v=always personal.xml
  52. personal.xml: 20 ms (37 elems)</source>
  53. <note>The time reported by the system may be different, depending on your
  54. processor speed.</note>
  55. </s3>
  56. </s2>
  57. </s1>