List XML element names/attribute
See
http://taporware.mcmaster.ca/~taporware/xmlTools/listxml.shtml
Description
This tool is used to display elements contained in an XML document. This tool also allows the user to count all instances of an element and to view the structure/hierarchy of the document. It also provides a variety of tools for listing attributes and attribute values.
Pseudocode
- Get input xml text either from user's local disk or from user specified URL
- Go through the entire xml text and record all the element name, along with the related attibute names and values.
- Process the the above records based on user specification and generate corresponding output
Ways of Using
- Enter text source in "Source text" panel, either a effective xml text URL in the URL field or a xml file path in your local disk
- Select what tou want to see from the "List options" panel.
- For each selection above, you have feuther selection of the details
- Select results display format from the "Results" panel.
CGI Interface
If you want to use this tool from your web site, here is the CGI Interface:
(
Note: You need to use attribute name/value pair: enctype="multipart/form-data" within the form tag because the tool was to designed to allow local file uploading even if you do not use this feature)
Here are the parameters:
| Parameter Name | Parameter Value | Control Type | Default | Discription |
| source | url/local | radio button | url | specify the source location |
| xmlurl | | text field | | A valid url corresponding to the value url of the parameter source |
| localFile | | file | | enter or browse to get the local file path |
| HowToList | 1/2/3 | radio button | 1 | allow user to select the way of element listings |
| countElem | | checkbox | false | indicate if the element will be counted for HowToList (1) |
| averageword | | checkbox | false | indicate if the average words in each element will be listed |
| displayAttr | | checkbox | false | indicate if the tree structure of the xml docs contains attributes (for HowToList 2) |
| countword | | checkbox | false | indicate if the number of words contained in each element be listed |
| listAttr | 1/2 | radio button | none | allow user to select either to contain attribute value or List elements containing attributes (for HowToList 3) |
| dispOp | 1/2/3/4 | selection | 2 | Display format which are XML tags in HTML/HTML/XML tree/tab Delimited Text in the order of parameter values |
| taporface | | checkbox | checked | display result in a new window without graphics interface (default) or with taporware interface in the same window |
Web Service Interface
Taporware provides web services to any non-benefit organizations. Here is the taporware web services infomation:
- Endpoint URL: http://taporware.mcmaster.ca:9982
- Service URI: http://taporware.mcmaster.ca/~taporware/webservice
- Service Method: list_XML_Elements_XML
- parameters:
- xmlInput -- any well formed xml string
- listOption -- values are same as parameter "range" in the CGI interface above
- optionSeletion -- values depend on the value of
listOption, but words counting is not included.
- outFormat -- values are same as parameter "dispOp" in the CGI interface above
Known Bugs
To Do
--
MattPatey - 13 Oct 2005