Declraing namespace schema with prefix in XSD/XML

Posted by user1493537 on Stack Overflow See other posts from Stack Overflow or by user1493537
Published on 2012-06-30T21:03:56Z Indexed on 2012/06/30 21:16 UTC
Read the original article Hit count: 426

Filed under:

I am new to XML and I have a couple of questions about prefix. I need to "add the root schema element and insert the declaration for the XML schema namespace using the xc prefix. Set the default namespace and target of the schema to the URI test.com/test1" I am doing:

<xc:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
       xmlns="http://test.com/test1"
       targetNamespace="http://test.com/test1">
</xc:schema>

Is this correct?

The next one is: "insert the root schema element, declaring the XML schema namespace with the xc prefix. Declare the library namespace using the lib prefix and the contributors namespace using the cont prefix. Set the default namespace and the schema target to URI test.com/test2" The library URI is http://test.com/library and contributor URI is test.com/contributor

I am doing:

<xc:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
       xmlns:lib="http://test.com/library"
       xmlns:clist="http://test.com/contributor"
       targetNamespace="http://test.com/test2">
</xc:schema>

Does this look right? I am confused with prefix and all.

Thanks for the help.

© Stack Overflow or respective owner

Related posts about xml-schema