CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Posts
    49

    Question edit namespace from XML

    Hi
    I want to remove the namespace attribute which comes automaticaly when i create the XML using Xmlbeans in the root element. How can i remove it? Becuase i am generating RSS XML. And RSS aggregator does not understand and consider the XML file as it is having namespace. If i remove namespace manualy it display properly RSS.

    my XML file :
    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0" xmlns="http://g.b.sys.com/a/RSS">
    <channel>
    <item>
    <description>feedback</description>
    <link>www.abc.com</link>
    <title>Feedback</title>
    </item>
    <description>null</description>
    <title>Home</title>
    <link>www.google.com</link>
    </channel>
    </rss>

    Now i wnat to remove that "xmlns" from my root element RSS. Hwo can i achieve it using XmlBeans it comes automaticaly.
    Last edited by ujjvalpandya; July 17th, 2008 at 12:29 AM.

  2. #2
    Join Date
    Sep 2006
    Posts
    49

    Thumbs up Re: Remove namespace from XML

    Quote Originally Posted by ujjvalpandya
    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0" xmlns="http://g.b.sys.com/a/RSS">
    .
    i got the thing.
    problem is not the namespace. its the way i write namespace using XMLBeans. It i write namespace as :
    <rss version="2.0" xmlns:a="http://g.b.sys.com/a/RSS">
    then RSS agregator reads it as RSS.
    so now i have to add ":a" or somthing after ":" then only it will work.

  3. #3
    Join Date
    Sep 2006
    Posts
    49

    Question Re: Remove namespace from XML

    Quote Originally Posted by ujjvalpandya
    i got the thing.
    problem is not the namespace. its the way i write namespace using XMLBeans. It i write namespace as :
    <rss version="2.0" xmlns:a="http://g.b.sys.com/a/RSS">
    then RSS agregator reads it as RSS.
    so now i have to add ":a" or somthing after ":" then only it will work.

    how can i add the postfix value to xmlns ?

    do i have to change the XSD? coz in my XSD its like :

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://g.sys.com/n/RSS"
    xmlns:tns="http://g.sys.com/n/RSS"
    elementFormDefault="qualified">

    i think that postfix values comes after xmlns only when we are having more than one namespace. so how can i add more than one namespace in XML file usinng XmlBeans.

    its urgent .please reply ASAP.thanks in advance.
    Last edited by ujjvalpandya; July 17th, 2008 at 12:51 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured