XMLTools - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Connectivity : Web Features : XMLTools : XMLTools/ElementType

XMLTools

 ElementType
 return the element type of a node in an XML tree
 ElementTypeName
 return the tag name of an element type of a node in an XML tree
 ElementTypePrefix
 return the prefix of an element type of a node in an XML tree
 ElementTypeURI
 return the URI of an element type of a node in an XML tree

 Calling Sequence ElementType(xmlTree) ElementTypeName(xmlTree) ElementTypePrefix(xmlTree) ElementTypeURI(xmlTree)

Parameters

 xmlTree - Maple XML tree; XML element

Description

 • The ElementType(xmlTree) command returns the element type of the XML element represented by the Maple XML tree xmlTree.
 • Unlike the string returned by XMLTools[ElementName], ElementType returns a data structure that includes full namespace information, when present, so that elements whose tag names print the same, yet belong to different namespaces, can be distinguished.

Examples

 > $\mathrm{with}\left(\mathrm{XMLTools}\right):$
 > $\mathrm{evalb}\left(\mathrm{ElementType}\left(\mathrm{XMLElement}\left("a"\right)\right)=\mathrm{ElementType}\left(\mathrm{XMLElement}\left("a",\left["xmlns"="http://someurl"\right],"some text"\right)\right)\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{evalb}\left(\mathrm{ElementType}\left(\mathrm{XMLElement}\left("p:a",\left["xmlns:p"="http://someurl"\right],"some text"\right)\right)=\mathrm{ElementType}\left(\mathrm{XMLElement}\left("p:a",\left["xmlns:p"="http://somOTHEReurl"\right],"some text"\right)\right)\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{evalb}\left(\mathrm{ElementName}\left(\mathrm{XMLElement}\left("p:a",\left["xmlns:p"="http://someurl"\right],"some text"\right)\right)=\mathrm{ElementName}\left(\mathrm{XMLElement}\left("p:a",\left["xmlns:p"="http://somOTHEReurl"\right],"some text"\right)\right)\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{ElementTypeName}\left(\mathrm{XMLElement}\left("p:a",\left["xmlns:p"="http://somOTHEReurl"\right],"some text"\right)\right)$
 ${"a"}$ (4)
 > $\mathrm{ElementTypePrefix}\left(\mathrm{XMLElement}\left("p:a",\left["xmlns:p"="http://somOTHEReurl"\right],"some text"\right)\right)$
 ${"p"}$ (5)
 > $\mathrm{ElementTypeURI}\left(\mathrm{XMLElement}\left("p:a",\left["xmlns:p"="http://somOTHEReurl"\right],"some text"\right)\right)$
 ${"http://somOTHEReurl"}$ (6)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam