Hi All,

I want to create the following xml from JAVA code. Can u please suggest me a way to write a JAVA code to generate the following xml.When I tried am not able to generate the title with xmlns.Please someone help me..I am very new to XML..... Even if u can provide me a way to generate the first three lines till user will do..Please help........

<

?xml version="1.0" encoding="UTF-8" ?> 
- <pierRecord xmlns="http://www.mywebsite.com/pier/schema/pier" xsi:schemaLocation="http://www.mywebsitecom/pier/schema/pier record.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <user>
  <submitterId>Arathy</submitterId> 
  <submitterName>Arathy</submitterName> 
   <sourceDatabase>My System</sourceDatabase> 
  <accessLevel>General Access</accessLevel> 
  <informationSensitivity>Confidential</informationSensitivity> 
  <personalIdentifyInformation>None</personalIdentifyInformation> 
  - <languages>
  <language>English</language> 
  </languages>?xml version="1.0" encoding="UTF-8" ?> 
- <pierRecord xmlns="http://www.mywebsite.com/pier/schema/pier" xsi:schemaLocation="http://www.mywebsitecom/pier/schema/pier record.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <user>
  <submitterId>Arathy</submitterId> 
  <submitterName>Arathy</submitterName> 
   <sourceDatabase>My System</sourceDatabase> 
  <accessLevel>General Access</accessLevel> 
  <informationSensitivity>Confidential</informationSensitivity> 
  <personalIdentifyInformation>None</personalIdentifyInformation> 
  - <languages>
  <language>English</language> 
  </languages>
</user>
  </pierRecord>
</user>
  </pierRecord>

Try This.

The xmlns will be an attribute of the <pierRecord> element.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.