Skip to Content
0
Former Member
Jun 13, 2007 at 07:28 AM

How do you modify xmlns in the generated xml from XI mapping?

158 Views

I am generating an xml file from XI mapping. Input is a simple xml (message type) and output is external definitions created by importing xsd. XML is in the end of this post.

<b>Issue</b>

1. In this xml, there are some elements with ns0 and others are not. When XML validator runs, it complains:

<b>"System.FormatException: Missing RecruiterReference/UserName element for Job with jobRefCode=001234 ....."</b>

How can I either have all the elements with ns0 or no qualifier in any element.

2. I need to add the following in the jobs (root) tag or job tag. How can I do that? Target system needs this to validate in order to validate against the schema.

xmlns="http://schemas.monster.com/Monster" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.monster.com/Monster http://schemas.monster.com/Current/xsd/Monster.xsd">

<b>Schema used</b>

This is the xml schema I am using. I have created external definitions by importing this schema and common.xsd and enumeration.xsd as well:

http://schemas.monster.com/Current/XSD/Job.xsdhttp://schemas.monster.com/Current/XSD/Job.xsd">http://schemas.monster.com/Current/XSD/Job.xsd>

<b>Generated XML</b>

<?xml version="1.0" encoding="UTF-8"?>

http://schemas.monster.com/Monster">>

<ns0:Job jobRefCode="001234" jobComplete="true" jobAction="addOrUpdate">

<ns0:RecruiterReference>

<b><UserName>NIS123456_jsmith</UserName></b>

</ns0:RecruiterReference>

<ns0:CompanyReference>

<CompanyXCode>xnis123456_jsmithx</CompanyXCode>

<CompanyName><![CDATA[

John Smith Press

]]></CompanyName>

</ns0:CompanyReference>

<ns0:Channel monsterId="58">

</ns0:Channel>

<JobInformation>

<JobTitle><![CDATA[

Printer

]]></JobTitle>

<JobType monsterId="1">

</JobType>

<JobStatus monsterId="4">

</JobStatus>

<Contact hideAll="false" hideStreetAddress="false" hideCity="false" hideState="false" hidePostalCode="false" hideCountry="false" hideContactInfoField="false" hideCompanyName="false" hideEmailAddress="false" hideFax="false" hideName="false" hidePhone="false">

<StructuredName>

<GivenName><![CDATA[

John

]]></GivenName>

<FamilyName><![CDATA[

Smith

Any help will be appreciated.

Thanks