grmstore
XML is stored using the x
datatype.
To store an XML string into an any node, use the x
type:
grmstore $grmIdXml root.child.##any x "<xml attr1=’value1’> childvalue</xml>"
Note: Currently, the
x
datatype can only be used on ##any
or ##anyAttributeNodes
and that
##any
or ##anyAttributeNodes
only accepts data with the x
datatype. When you must store multiple wildcard nodes to a wildcard field, you
can list the multiple values as you would for grmstore in other formats. Only those addresses terminating in
##any
or ##anyAttribute
accept XML type nodes.
For example, two values were retrieved using:
Input: grmfetch $grmIdXml ns1:root.ns1:xml.##anyAttribute
Output: datum0 datum1
To store these two values there are these choices:
- Using the
x
type:set dh1 [datget datum0 VALUE] set dh2 [datget datum1 VALUE]grmstore $grmIdXml_2 root.xml.##anyAttribute x $dh1 $dh2
- Using the
datum
type:grmstore $grmIdXml_2 root.xml.##anyAttribute d datum0 datum1
- Using the
c
type:grmstore $grmIdXml_2 root.xml.##anyAttribute c attr1=’123’ -xml attr2=’456’ -xml