Preserving Timezone from Java to XML

Hi,
I am writing a web-service for date time functions.
In the response for my web-service, I will send a time (xsd:time) say 4 PM EST. But when the marshalling happens, the 16:00:00-05:00 is automatically converted to 21:00:00Z. (EST to GMT conversion happends automatically). But i dont want this to happen, the caller should see the timezone I am sending them.
The xml data type is xsd:time and the corresponding Java Object is java.util.Calendar.
Is there a way to do this.
Thanks in advance for your replies.

VenkyThaniks wrote:
The xml data type is xsd:time and the corresponding Java Object is java.util.Calendar.This question doesn't appear to be related to Sun Calendar Server.
I suggest you ask on the java programming forum:
http://forums.sun.com/forum.jspa?forumID=31
Regards,
Shane.

Similar Messages

  • How2 create xml & ent  files from JAVA? (xml that gets data from ent file)

    Is there any API that can make it easy?
    * For parsing XML I use JDOM parser
    I want to create file like this:
    XML file: some.xml
    <?xml version="1.0"?>
    <!DOCTYPE xfat [
    <!ENTITY  d_request SYSTEM  "some.ent">
    ]>
    <!--
    /home/bNUMBER/Programs/XFAT/runxfat some.xml
    -->
    <xfat title = 'Fat Title (some) '>
    <database  filename = 'Some_Data/some.xml'/>
    <snc  filename  = "../snc/snc.xml"/>
    <configuration sp = '../sp/some_only.xml' name='Some_A-H'>
       &d_request;
    </configuration>
    </xfat>and ent file:
    <ddef title    = 'some d def title (some)'>
         <dcalc  snc    = '7_A9'
                meas   = 'm73'
                red    = 'GOOD' binval='MCMS' lug='YES'/>
    </ddef>

    has anyone idea what to search?

  • Convert java to xml -urgent

    hi,
    I'm currently doing a project which requires me to generate a svg scatterplot graph. I already got data stored in vector.(in a servlet).But heard from my supervisor that i need to convert my data to xml format.With this xml format, i can generate a svg graph.I'm totally new to xml n don't know how to convert from java to xml..Though i read up on articles, i still can't get the idea of it. My data isnt very big. for graph i need to generate a x-axis :green , y-axis:red... n then retrieve the data n plot the scatterplot graph... can somebody help me??? very urgent... thanks

    One quick way is to construct the XML your self.
    e.g.
    StringBuffer xml = new StringBuffer("<?xml version="1.0" encoding="ISO-8859-1"?>");
    xml.append("<ROOT>");
    while(has more elements) {
    xml.append("<ELEMENT>").append(data).append("</ELEMENT>");
    xml.append("</ROOT>");
    Rene

  • Generation of xml file from java code

    hi,
    I want to manipulate data in a xml file with java code.I have read data from xml file and also changed it. But i am unable to covert it again in xml file from java code. Can you please tell me how i can do this?

    Let me know which parser are you using currently for reading xml files so that i assist you. For now, you can refer to STAX Parser API under this link
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP3.html

  • Converting from PDF directly to Java Objects/XML (and PDF format questions)

    Hi,
    I posted this originally in the Acrobat Windows forums but was told I might have more luck here, so here goes:
    I am desperately trying to find a tool (preferably open source but commercial is fine also) that will sit on top of a PDF and allow me to query it's text for content and formatting (I don't care about images). I have found some tools that get me part of the way there, but nothing that seems to provide an end-to-end solution but is quite lightweight. My main question is WHY are there so many tools that go from PDF to RTF, and many tools that go from RTF to XML, but NONE that I can find that go PDF to XML.
    To clarify, by formatting I simply mean whether a line/block of text is bold/italic, and its font size. I am not concerned with exact position on the page. The background is that I will be searching PDFs and assigning importance to whether text is a heading/bodytext etc. We already have a search tool in place so implementing a pure PDF search engine is not an option. I need a lightweight tool that simply allows me to either make calls directly to the PDF OR converts to XML which I can parse.
    Some tools I have tried:
    1) PDFBox (Java Library) - Allows the extraction of text content easily, but doesn't seem to have good support for formatting.
    2) JPedal (Java Library) - Allows extraction of text content easily, and supports formatting IF XML structured data is in the PDF (not the case for my data).
    3)  Nitro PDF (Tool) + RTF to XML (script) - This works quite nicely and shows that PDF to XML is possible, but why do I have to use 2 tools? Also, these are not libraries I can integrate into my app.
    4) iText (Java Library) - Seems great at creating PDFs but poor at extracting content.
    I don't really expect someone to give me a perfect solution (although that would be nice!).
    Instead, what I'd like to know is WHY tools support PDF to RTF/Word/whatever retaining formatting, and other tools support RTF to XML with the formatting information retained. What is it about PDF and RTF/Word that makes it feasible to convert that way, but not to XML. Also, as I found in 3) above, it is perfectly feasible to end up as XML from PDF, so why do no tools support this reliably!
    Many thanks for any advice from PDF gurus.

    XML doesn't mean anything - it's just a generic concept for structuring
    information.  You need a specific GRAMMAR of XML to mean anything.  So what
    grammar would you use?  Something standard?  Make up your own?
    However, there are a number of commercial and open source products that can
    convert PDF to various XML grammars - SVG, ABW, and various custom grammars.
    But the other thing you need to understand is that most PDF files do not
    have any structure associated with them (as you saw when using JPEDAL).  As
    such, any concepts of paragraphs/sections/tables/etc. Are WILD GUESSES by
    the software in question.

  • Reg XML generation from java objects using SAX 2.0

    i'm using java 1.6 and i've imported following class to generate XML from java objects
    import com.sun.org.apache.xml.internal.serialize.OutputFormat;
    import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
    the following class has been imple her to create a Xml file and tag elements ,
    OutputFormat of = new OutputFormat("XML", "iso-8859-1", true);
    XMLSerializer serializer = new XMLSerializer(fos, of);
    ContentHandler hd = serializer.asContentHandler();
    hd.startDocument();
    everything works fine but i'm getting warrnin reg the serializer and outputformat
    warring is:
    com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release
    com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release
    HOW CAN I AVOID DS WARRING PLZ HELP REG DS
    thanks ,
    with regards,
    Rajesh.S

    I've been having the same problem. Here is what i found:
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6476630]
    Hope that helps (or at least helps you feel better).

  • How to edit the existing data in the XML file from java programming.

    Hi all
    i am able to create XML file with the sample data as below from java programming.
    i need sample code on how to edit the existing data in the XML file?
    for example
    <?xml version="1.0"?>
       <mydata>
               <data1>
                         <key1>467</key1>
                        <name1>Paul</name1>
                        <id1>123</id1>
              </data1>
              <data2>
                         <key2>467</key2>
                        <name2>Paul</name2>
                        <id2>123</id2>
              </data2>
        </mydata>
    i am able to insert the data in the XML.
    now i need sample code on how to modify the data in the above XML file from the java programming for only key2,name2,id2 tags only. the remaining tags data in the XML file i want to keep same data except for key2,name2,id2 which are i want to modify from java code
    Regards
    Sunil
    [points will be always rewardable]

    hi
    u need a parser or validate the xml file for to read the xml file from java coding u need for this
    xml4j.jar u can download this file  from here
    http://www.alphaworks.ibm.com/tech/xml4j
    or we can use the SAX(simple API for XML)
    some sample applications for this
    http://www.java-tips.org/java-se-tips/javax.xml.parsers/how-to-read-xml-file-in-java.html
    http://www.developertutorials.com/tutorials/java/read-xml-file-in-java-050611/page1.html
    http://www.xml-training-guide.com/e-xml44.html
    let me know u need any other info
    bvr

  • How I can create a XML file from java Aplication

    How I can create a XML file from java Aplication
    whith have a the following structure
    <users>
    <user>
    <login>anyName</login>     
    <password>xxxx</password>
    </user>
    </users>
    the password label must be encripted
    accept any suggestion

    Let us assume you have all the data from the jsp form in an java bean object..
    Now you want a xml file. This can be acheived in 2 ways
    1. Write it into a file using java.io classes. Say you have a class with name
    write("<name>"+obj.getName+</name>);
    bingo you have a flat file with the xml
    2. Use data binding to do the trick
    will recommend JiBx and Castor for the 2nd option
    Regards,
    Rajagopal

  • Creating XML file from Java Bean

    Hi
    Are there any standard methods in Java 1.5 to create XML file from java bean,
    i can use JAXB or castor to do so,
    But i would like to know if there is any thing in java core classes,
    I have seen XMLEncoder, but this is not what i want.
    Any ideas
    Ashish

    Marshall JavaBean to an XML document with JAXB or XMLBeans.

  • How to modify an existing xml file from java code.

    Hi
    I have worked on creating a new xml file from java code using xmlbeans.But if i try to modify an already existing file using java code I am unable to get errorfree xmlfile.
    For example if xml file(studlist.xml) is as below:
    <?xml version="1.0" encoding="UTF-8"?>
    <StudentList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\kchaitanya\xmlprac1\abc\Studlist.xsd">
         <Student>
              <Name>ram</Name>
              <Age>27</Age>
         </Student>
    <Student>
              <Name>sham</Name>
              <Age>26</Age>
         </Student>
    </StudentList>
    Now suppose i have set name to victor using student.setName,
    and set age to 20 using setAge from javacode,
    the new xml file is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <StudentList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\kchaitanya\xmlprac1\abc\Studlist.xsd">
         <Student>
              <Name>ram</Name>
              <Age>27</Age>
         </Student>
    <Student>
              <Name>sham</Name>
              <Age>26</Age>
         </Student>
    </StudentList>
    <Student>
              <Name>victor</Name>
              <Age>20</Age>
         </Student>
    As observed this is not a valid xml file.But how can i modify without any errors?

    I know it's an old post, but I found this while doing a google search for something else, and don't like to leave it un-aswered
    Just in case anyone has a similar problem... In this case the new elements have been appended outside of the root element
    What you need to do is first get the root element and then append the new children to that, there are several ways of getting the root element, which depend on what you want to do with the elements you get back here's a simple (incomplete) way.
    // gets the root element of the specified file (code not shown)
    Element rootElement= new SAXReader().read(file).getRootElement();Then just append the new elements as below (this is non-generic code and would need to be modified for your situation)
    // write a new student element
    Element student = document.createElement("Student");  // creates the new student
    rootElement.appendChild(student); // ***appends it to the root element***
    Element name = document.createElement("Name"); // creates the name element
    name.appendChild(document.createTextNode("Fred")); // adds the name text to the name element
    student.appendChild(name); // appends the name to the student
    Element age= document.createElement("Age"); // creates the age element
    age.appendChild(document.createTextNode("26")); // adds the age text to the age element
    student.appendChild(age); // appends the name to the studentThen flush ya buffers or whatever and write the file
    Edited by: Dream-Scourge on Apr 23, 2008 11:10 AM

  • Moving from com.sun.xml classes to the new xml support integrated in java

    So far, for our XML implementation, we have used the DocumentEx, ElementEx, etc. from com.sun.xml.
    We understand that xml is now supported by the java itself (javax.xml.parsers?) and we wish to update our code to use the newer API.
    Is there a simple mapping between the old DocumentEx and ElementEx and new classes in javax.xml? Can it really be simple to "get rid" of com.sun.xml?

    The combination of the:
    Oracle XML SQL Utility
    and
    Oracle XML Parser for PLSQL V2
    give you what you need.
    null

  • XML parsing regressing from Java 1.4 to 1.5

    Hi,
    I have a piece of code using Jakarta digester. This piece of code is prety simple and was working fine until I switched from java 1.4 to java 1.5. However, i didn't changed the Digester jar.
    After investigation, I noticed that the problem disappear if i remove the DOCTYPE entry from the XML file I'm parsing.
    Is there any known regression ?
    Thanks =P
    Stack Trace
    java.net.UnknownHostException: D
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
         at sun.net.NetworkClient.openServer(NetworkClient.java:118)
         at sun.net.ftp.FtpClient.openServer(FtpClient.java:488)
         at sun.net.ftp.FtpClient.openServer(FtpClient.java:475)
         at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:270)
         at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:352)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:973)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:905)
         at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:872)
         at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:282)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:1021)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)Error while getting input files description. Process aborted.
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
         at org.apache.commons.digester.Digester.parse(Digester.java:1556)
         at com.wwdm.datahandle.TransformDescriptorFactory.getTransformer(TransformDescriptorFactory.java:99)
         at mainTest.main(mainTest.java:29)
    XML
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE descriptor SYSTEM "file://D:/dtds/WWDM_Input.dtd">
    <descriptor>
    </description>
    ------

    I made an error in my XML while posting... so just to avoid replies telling it cames from there :
    XML
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE descriptor SYSTEM "file://D:/dtds/WWDM_Input.dtd">
    <descriptor>
    </descriptor>

  • Printing xml spreadsheet file from java

    Does anyone know if it is possible to print an xml spreadsheet file directly from java.
    I'm quite new to java and any help would be greatly appreciated.
    Thanks in advance.

    Does anyone know if it is possible to print an xml
    spreadsheet file directly from java.
    I'm quite new to java and any help would be greatly
    appreciated.
    Thanks in advance.Are you crazy, mad or stupid???
    Just messing.....
    If you're new to Java then don't bother. Otherwise try [url http://jakarta.apache.org/poi/index.html]here for jakarta's API.
    Honestly though, if you're not new to programming then fair enough. BUT, if you are new to Java and programming then acknowledge the fact you'll have to whack yourself alot before u get anywhere.
    Ted.

  • Xml Processing from java

    I want to read xml from java .I store some configurations inforamtion in xm file
    What is the best way to process xml form java keeping in mind the easy to use,
    efficiency.There are so many ways i am very confused .Can anyone please direct me to any good tutorials which they come across.
    Thanks

    you should take a look to jakarta commons Digester

  • JAXB 1: is it possible to go from enum simulation in Java to XML Schema?

    I know how to get an enum simulation in java from XML schema, but can it be done in the other direction, in the context of a web service implementation?
    The thing is from schema to java a customization file is used. But there's no specification for such a customization file usability when going from java to schema. So far, i'm getting a string for enum wrapper.

    Well, i got it to work in JAXB 1, w/o xfire, schema-to-java. Marshall and unmarshall.
    But w/ xfire, it doesn't appear to be possible. Would probably require implementing it for them myself...

Maybe you are looking for

  • Game download - can't get it onto ipod using Mac

    I recently downloaded a game for my Ipod from a website but cannot figure out how to get it on my ipod because the instructions are for a windows computer and I have a mac. the instructions ask me to go to my ipod drive so that i can drag the file in

  • My iPod Nano won't update new songs onto it!

    Alright, so i went to go download new music one day in the Music Store and it said that I needed to download iTunes 6.0.2 or whatever its called. So i finally got the download to work and all my old music showed up and everything was fine. Then i dec

  • How can I auto-update all book file links after making a new copy of my project?

    Using Indesign CC 2014, Windows 7x64. I've created a catalog, using a book file (.indb) which connects 20 Indesign files (.indd) together (so page numbering is continuous, etc). Each of the 20 Indesign files all have numerous art asset links and cros

  • Fixing kernal panic issue necessary before updating OS?

    I've been using 10.4.11 for nearly two years and it usually crashes once or twice a day. I've posted my problem on this forum twice and none of the many suggestions solved the problem. I've replaced my hard drive and had the memory checked and reseat

  • Problem on Transporting

    Hai, Expect an answer from you gurus for a strange problem which I face right now. I had a TMG and it was working fine. Now I had to transport it to another landscape and after the transport, the TMG seems to be lost. While transporting, the concerne