This sample illustrates how you can use an XML cursor
to manipulate the content of an element. Even though
working with strongly-typed XML (in which you are accessing
the XML through an API generated from schema) provides easy
access for getting and setting the entire value of an
element or attribute, it does not easily provide finer
grained access to an element's content. This sample
shows how you can use an XML cursor to "dive into" an
element's content, manipulating it on a character-by-
character level.
The code in this sample is designed to look at the
description of each item in an inventory list, creating
a link wherever the description contains a reference
to another item in the inventory list. This alters the
<description> element so that it contains a mix of text and
link elements. Such an element is said to have "mixed
content."
This sample uses the schema defined in inventory.xsd.
|