Skip to main content
IBM  
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : XML : Education - Tutorials
XML Schema Infoset Model, Part 1
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackNext
6. Working with namespaces
  


QName prefix namespace map page 1 of 3


The QName prefix namespace map stores a prefix as the keys and namespace Uri as the values. This QName prefix namespace map is stored on the root XSDSchema object and is used when XSDNamedComponents need to be resolved.

If you want to add additional prefix-namespace pairs to a given XML Schema file, you can do the following:


//Add additional prefix-namespace pair xmlns:address="http://www.eclipse.org/xsd/examples/address"
qNamePrefixToNamespaceMap.put("address","http://www.eclipse.org/xsd/examples/address");

The above code snippet produces the following serialized XML Schema model:


<?xml version="1.0"?>
<schema targetNamespace="http://www.eclipse.org/xsd/examples/createxsd"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:address="http://www.eclipse.org/xsd/examples/address" 
    xmlns:createxsd="http://www.eclipse.org/xsd/examples/createxsd"/>

Main menuSection menuFeedbackNext
About IBM | Privacy | Legal | Contact