Join wMUsers | Blog at wMUsers | Edit my wMUsers Profile | Site Map | webMethods Jobs |For Employers

wMUsers  
  #1  
Old 01-22-2010, 20:39
david123 david123 is offline
Member
 
Join Date: Nov 2008
Posts: 86
Thanks: 4
Thanked 0 Times in 0 Posts
Default How to remove Prefix from XSD to DocumentType

Hi all,

I have an XSD. Its sample namespace is.

<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:bb="http://www.xxxxxx"
targetNamespace="http://www.xxxxxx">

When I create a document type from this XSD. The document type values are containing bb in front of each field. But I want to generate an XML which do not contain bb in front of the fields.

Now it is this way,

bb:name
bb:age
bb:location

But I want an xml which has

name
age
location

Can you please suggest how to remove namespace. I do not want to change the XSD.

Please help.
Reply With Quote
Advertisement
  #2  
Old 01-23-2010, 05:00
hido hido is offline
Junior Member
 
Join Date: Nov 2004
Posts: 22
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by david123 View Post

Can you please suggest how to remove namespace. I do not want to change the XSD.
Hi David

I don't think you can remove the namespace prefix without changing the XSD. The namespace prefix is a part of the element name now. For example:
"bbb:Customer" is not the same as "Customer", as these two elements may belong to difference namespaces.
You can try to change the element names manually in Developer, but I am not sure if this will work. Another workaround you can use is to define your own data format (canonical or internal), and then map the XSD format into this before doing any further mapping/transformations.

Regards,

Hido
Reply With Quote
  #3  
Old 01-24-2010, 06:55
ajaynaina ajaynaina is offline
Member
 
Join Date: Sep 2005
Posts: 63
Thanks: 0
Thanked 1 Time in 1 Post
Default

It can be done by using elementFormDefault="unqualified" in the schema definition but this would require updating the XSD.

<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:bb="http://www.xxxxxx"
targetNamespace="http://www.xxxxxx" elementFormDefault="unqualified">
Reply With Quote
  #4  
Old 01-30-2010, 01:54
hido hido is offline
Junior Member
 
Join Date: Nov 2004
Posts: 22
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by ajaynaina View Post
It can be done by using elementFormDefault="unqualified" in the schema definition but this would require updating the XSD.

<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:bb="http://www.xxxxxx"
targetNamespace="http://www.xxxxxx" elementFormDefault="unqualified">
Yup, that would be the easiest way of doing it if your XSD only contains one name space. However this will not work if your XSD refers to, or imports, elements from another schema which are defined by a namespace prefix.
Reply With Quote
  #5  
Old 03-25-2010, 13:50
ramesh_kuruba ramesh_kuruba is offline
Senior Member
 
Join Date: Mar 2004
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had to remove xmlns:bb="http://www.xxxxxx"
targetNamespace="http://www.xxxxxx to get this loaded right interestingly

RK
Reply With Quote
  #6  
Old 03-31-2010, 11:34
leonlee leonlee is offline
Senior Member
 
Join Date: Apr 2005
Posts: 165
Thanks: 0
Thanked 0 Times in 0 Posts
Default

convert your document to XML values by using documentToXMLValues, next call transformer service pub.string.replace and map the xml values to inString search for bb: replace with just leave it blank next map the output value back to xml values and XMLValuesToDocument buildin service.

HTH
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert xsd file to IS document? rj40565 If it doesn't fit anywhere else 3 01-20-2009 02:53
Dynamic XSD creation kishoreark Flow and Java services 3 01-31-2006 09:21
Validating XSD Schema against an XML elbert Flow and Java services 1 05-14-2005 05:06


All times are GMT -6. The time now is 23:51.


.
All Content Copyright ©2002-2009, Conneva, Inc. DBA wMUsers.Com

wMUsers is an independent organization and is not sponsored in any manner by Software AG or webMethods, Inc.

Page generated in 0.08311 seconds with 18 queries