xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Franco Lazzarino <f...@ufl.edu>
Subject inserting attribute error
Date Thu, 22 Jul 2004 22:33:40 GMT
why is "xsi:schemaLocation" an invalid attribute name?
is there another way to put the xsi:schemalLocation attribute in the
root element?

CODE:
XmlCursor cursor = root.newCursor();
QName name = new QName("xsi:schemaLocation");
String value = "http://www.loc.gov/METS/ " +
	       "http://www.loc.gov/standards/mets/mets.xsd";
cursor.insertAttributeWithValue(name, value);

OUTPUT:
Exception in thread "main" java.lang.IllegalArgumentException: Name is
not valid
at
org.apache.xmlbeans.impl.store.Cursor.validateLocalName(Cursor.java:773)
at
org.apache.xmlbeans.impl.store.Cursor.validateLocalName(Cursor.java:761)
at
org.apache.xmlbeans.impl.store.Cursor.insertAttributeWithValue(Cursor.java:833)
	...
	...
	...




- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message