cancel
Showing results for 
Search instead for 
Did you mean: 

XSD for XML with "noNamespaceSchemaLocation" attribute

Former Member
0 Kudos

I need to generate an XML output from XI as follows;

<b><admin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="csm_admin.xsd"></b>, where 'admin' is my root node.

I have been unsuccessful trying to design the correct XSD for this requirement. The following XSD format (that i tried) generates an XML format replacing xsi: and :xsi with ns29: and :ns29 respectively. Any idea how i can override this?

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified">

<xs:element name="admin">

<xs:attribute ref="xsi:noNamespaceSchemaLocation" use="required"/>

</xs:element>

</xs:schema>

I saw the following related documentation on a site;

"For an XML document that uses the noNamespaceSchemaLocation attribute, the root-element business object definition must contain an attribute with the following properties:

1) The attribute name is noNamespaceSchemaLocation and this attribute is of type String.

2) The attribute must have the type=xsinoNSlocation tag in its application-specific information.

When an attribute represents the schemaLocation or noNamespaceSchemaLocation XML attribute, it does not require the type=attribute tag in its application-specific information."

But, i am not sure where to set the application-specific attribute type=xsinoNSlocation. Can somebody please help?

Thank you for your time & effort,

Smitha John

Message was edited by: Smitha John

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi John,

when your only problem is that the generated xml uses 'ns29' instead of 'xsi', that should not be a problem.

Both possibilities are absolutely equivalent, as the namespace prefix is only a local alias. It is just for convenience of human readers that most authors use 'xsi' for the namespace http://www.w3.org/2001/XMLSchema-instance.

Note e.g. that for the same reasons most people use 'xsd' as alias for the namespace http://www.w3.org/2001/XMLSchema, whereas anothert group (including you) prefer to use 'xs'. Both possibilities are equivalent. You could also use 'ILikeLongPrefixes', or 'IAmAFanOfRobbieWilliams' instead. Logically this is all the same. Some human readers might find it more difficult to read (amd some might flame you because they do not like Robbie Williams).

Greetings

Stephan