|
Hi Yixing You can use the XmlCursor to insert
attributes. Use the cursor to navigate to the element on which you wish to add
the attributes. After that do something like the following: QName
attQN = new QName("http://www.w3.org/2001/XMLSchema-instance",
"noNamespaceSchemaLocation",
"xsi"); c.insertAttributeWithValue(attQN,
"C:\\Documents and Settings\\User\\Desktop\\r&r.xsd"); To get an XmlCursor simply call
newCursor() on any XmlObject. I tried this in a test program and both
the attribute and namespace declaration were automatically put in as you wish. Cheers, From: Yixing Ma
[mailto:[EMAIL PROTECTED] Hi, I just switched to XMLBeans from JAXB. Now I have a question about writing to a file from XMLBeans. <?xml version="1.0"
encoding="UTF-8"?> I want to include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="C:\Documents and
Settings\User\Desktop\r&r.xsd" information into the newly created XML file. But don't know
how. Anyone can help? Regards, YODA909 |
- newbie need help Yixing Ma
- RE: newbie need help Lawrence Jones
- RE: newbie need help Lawrence Jones

