wink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas L Gallardo <nlgal...@us.ibm.com>
Subject Re: FW: Question about XML namespace prefix in Atom XML representation generated by Wink 1.0
Date Mon, 08 Feb 2010 14:31:05 GMT
Hi Caron,

Removing the "ns6" namespace would result in an invalid XML document.  By
removing the namespace, you'd be declaring the elements in your content to
be part of the default namespace, which in this case is defined as the Atom
namespace.

Question: What is the format of the content that you're passing in to the
DOMSource constructor?

> entry.setContent(new SyndContent( new DOMSource(om), MediaType.TEXT_XML,
false) );

Also, does the content in the "om" object not already contain a namespace
definition?  Another approach might be defining the namespace in the
content that you pass in so that one doesn't have to be added for you
subsequently.

-Nick





                                                                           
             "Zhao, Kun                                                    
             (Caron,HPSW-BTO-R                                             
             &D-SH)"                                                    To 
             <kun.zhao@hp.com>         "wink-user@incubator.apache.org"    
                                       <wink-user@incubator.apache.org>,   
             02/08/2010 06:35          "wink-dev@incubator.apache.org"     
             AM                        <wink-dev@incubator.apache.org>     
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
             wink-dev@incubato         FW: Question about XML namespace    
               r.apache.org            prefix in Atom XML representation   
                                       generated by Wink 1.0               
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hello,
                Who can help on this issue? Thanks.

Regards,
Caron

From: Liu, Jing (LJ, HPSW-BTO-R&D-SH)
Sent: Monday, February 08, 2010 8:19 PM
To: wink-user@incubator.apache.org
Cc: Zhao, Kun (Caron,HPSW-BTO-R&D-SH)
Subject: Question about XML namespace prefix in Atom XML representation
generated by Wink 1.0

Hi guys,

My question is about the xml format.

Suppose I am using SyndEntry to build an Atom entry

      SyndEntry entry = new SyndEntry( getTitle(), getId(), getUpdated());
       entry.setSummary(new SyndText( getSummary()));
      entry.setContent(new SyndContent( new DOMSource(om),
      MediaType.TEXT_XML, false) );

See the word highlight in red, I am setting an XML content to the ATOM
entry.

I got following XML representation from Wink in my client:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:ns2="
http://a9.com/-/spec/opensearch/1.1/" xmlns:ns3="
http://www.w3.org/1999/xhtml">

<id>urn:x-hp:software:servicemanager:incident:id:66B778C1-7337-4307-8754-3DC4DB66C82D</id>
                <updated>2010-02-01T16:46:36.000+08:00</updated>
                <title type="text">IM10006</title>
                <summary type="text">Everyday around lunch time my PC
starts rebooting for no apparent reason. Can you please check what's wrong?
I get an error message about CPU temperature.</summary>
                <link href="
http://smci022.asiapacific.hpqcorp.net:23080/SM/7/rest/1.1/incident_list/reference_number/IM10006?alt=application%2Fjson
" type="application/json" rel="alternate"/>
                <content type="text/xml">
                                <ns6:incident xmlns:incident="
http://www.hp.com/2009/software/data_model" xmlns="" xmlns:ns6="
http://www.hp.com/2009/software/data_model" relationships_included="false"
self="
http://smci022.asiapacific.hpqcorp.net:23080/SM/7/rest/1.1/incident_list/reference_number/IM10006
" type="urn:x-hp:2009:software:data_model:type:incident" version="1.1">
                                                <ns6
:global_id>urn:x-hp:software:servicemanager:incident:id:66B778C1-7337-4307-8754-3DC4DB66C82D</ns6:global_id>
                                                <ns6:name>Pop-up appears
while working with Office, Office needs installation of additional
components</ns6:name>
                                                <ns6:description>Everyday
around lunch time my PC starts rebooting for no apparent reason. Can you
please check what's wrong? I get an error message about CPU
temperature.</ns6:description>
                                                <ns6
:last_modified_time>2010-02-01T08:46:36+00:00</ns6:last_modified_time>
                                                <ns6
:active_process>true</ns6:active_process>
                …
                …

We saw the “ns6:” prefix in the eventual xml content. That’s Wink
automatically generated for us, we know this is valid and good for prevent
namespace mess.
But is there any way we can change this automated prefix or maybe remove
it, or take control how to format an ATOM entry’s xml representation?

Since “ns6” sometimes looks a little bit ugly, if we may customized it with
a more human readable, meaningful  prefix, that will be better.

Best Regards,

Liu Jing (LJ,HPSW-BTO-R&D-SH)
cid:859565509@08012009-243D
Shanghai Engineering Lab
BTO Operations SPM R&D
Hewlett-Packard Company
Tel: 021-38896806
Mime
View raw message