Converting XML into a Object

Hi,
I'm trying to convert an xml object to a plain actionscript
3.0 object. I've looked at SimpleXMLDecoder but without much luck.
Any help or advice would be appreciated

Have you tried
[code]
var data:Object = xmlData as Object;
[/code]
Although one of the capabilities with AS3 and E4X is that xml
data is accesible as an object. I mean
xmlData.node1.node2.(@attribute1) etc...

Similar Messages

  • Convert MBox into XML into Java Objects

    Hello all,
    this is a general question, i dont know weather there is such libs or not.
    However, please tell me what you know.
    i want to program a java application for searching purpose in Mbox.
    i thought its possible and easier to try to convert the emails from the MBox into XML files, and from these create java objects when i need or even convert the XML into html for viewing.
    Any suggestions are welcome.
    Also antoher solutions are greate.
    thanks in advance!
    Sako.

    I don't know what this MBox you speak of is - I assume it's not the thing I use to hook upa guitar to GarageBand. Maybe you mean it as a generic term for mailbox? The easiest solution (to my mind) would be to use a Java API provided by whatever MBox is. If there is no such thing, then if you get XML-formatted version of the messages I suppose writing code to parse the XML into Java Objects would be a good option if you wanted to do further manipulation of them, but if all you want to do is display them as HTML in a browser then just use XSLT to transform them.
    Good Luck
    Lee

  • Convert xml into SAP using dataset

    Hi All,
    How to convert XML into itab using dataset, in this conversion have any function module available? please give me a sample program (having any). and material also.
    Thanks,
    Suresh maniarasu

    Hi,
    First you need to get the XML file Data into SAP using the  Function Module and can populate the data into an inernal table.
    TEXT_CONVERT_XML_TO_SAP
    DMC_CONVERT_XML_TO_TABLE
    or you can use the following classes
    CL_RSRD_CONVERTER_XML
    CL_WDR_XML_CONVERT_UTIL
    CL_EXM_IM_ISHCM_CONV_XML_SAP
    Thank U,
    Jay....

  • JAXB and inheritance. Converting xml to java object

    I have a schema "FreeStyle.xsd" i used JAXB to generate POJO's . I get around 15 classes. I have a config.xml which is compliant to this schema . Now i want to write a java program which takes the config.xml and converts it into a java object . Please anybody help me with this . Thanks in advance
    Freestyle.xsd
    <?xml version="1.0" encoding="windows-1252"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="FreeStyleProject" type="hudson.model.FreeStyleProject"/>
    <xsd:complexType name="hudson.model.FreeStyleProject">
      <xsd:complexContent>
       <xsd:extension base="hudson.model.Project">
        <xsd:sequence/>
       </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.Project">
      <xsd:complexContent>
       <xsd:extension base="hudson.model.BaseBuildableProject">
        <xsd:sequence/>
       </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.BaseBuildableProject">
      <xsd:complexContent>
       <xsd:extension base="hudson.model.AbstractProject">
        <xsd:sequence/>
       </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.AbstractProject">
      <xsd:complexContent>
       <xsd:extension base="hudson.model.Job">
        <xsd:sequence>
         <xsd:element name="concurrentBuild" type="xsd:boolean"/>
         <xsd:element name="downstreamProject" type="hudson.model.AbstractProject"
                      minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="scm" type="hudson.scm.SCM" minOccurs="0"/>
         <xsd:element name="upstreamProject" type="hudson.model.AbstractProject"
                      minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
       </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="hudson.scm.SCM">
      <xsd:sequence>
       <xsd:element name="browser" type="hudson.scm.RepositoryBrowser"
                    minOccurs="0"/>
       <xsd:element name="type" type="xsd:string" minOccurs="0"/>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="hudson.scm.RepositoryBrowser">
      <xsd:sequence/>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.Job">
      <xsd:complexContent>
       <xsd:extension base="hudson.model.AbstractItem">
        <xsd:sequence>
         <xsd:element name="buildable" type="xsd:boolean"/>
         <xsd:element name="build" type="hudson.model.Run" minOccurs="0"
                      maxOccurs="unbounded"/>
         <xsd:element name="cascadingChildrenName" type="xsd:string" minOccurs="0"
                      maxOccurs="unbounded"/>
         <xsd:element name="color" type="hudson.model.BallColor" minOccurs="0"/>
         <xsd:element name="firstBuild" type="hudson.model.Run" minOccurs="0"/>
         <xsd:element name="healthReport" type="hudson.model.HealthReport"
                      minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="inQueue" type="xsd:boolean"/>
         <xsd:element name="keepDependencies" type="xsd:boolean"/>
         <xsd:element name="lastBuild" type="hudson.model.Run" minOccurs="0"/>
         <xsd:element name="lastCompletedBuild" type="hudson.model.Run"
                      minOccurs="0"/>
         <xsd:element name="lastFailedBuild" type="hudson.model.Run" minOccurs="0"/>
         <xsd:element name="lastStableBuild" type="hudson.model.Run" minOccurs="0"/>
         <xsd:element name="lastSuccessfulBuild" type="hudson.model.Run"
                      minOccurs="0"/>
         <xsd:element name="lastUnstableBuild" type="hudson.model.Run"
                      minOccurs="0"/>
         <xsd:element name="lastUnsuccessfulBuild" type="hudson.model.Run"
                      minOccurs="0"/>
         <xsd:element name="nextBuildNumber" type="xsd:int"/>
         <xsd:element name="property" type="hudson.model.JobProperty" minOccurs="0"
                      maxOccurs="unbounded"/>
         <xsd:element name="queueItem" type="hudson.model.Queue-Item"
                      minOccurs="0"/>
        </xsd:sequence>
       </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.Queue-Item">
      <xsd:complexContent>
       <xsd:extension base="hudson.model.Actionable">
        <xsd:sequence>
         <xsd:element name="blocked" type="xsd:boolean"/>
         <xsd:element name="buildable" type="xsd:boolean"/>
         <xsd:element name="id" type="xsd:int">
          <xsd:annotation>
           <xsd:documentation>VM-wide unique ID that tracks the {@link Task} as it
                              moves through different stages in the queue (each
                              represented by different subtypes of {@link Item}.</xsd:documentation>
          </xsd:annotation>
         </xsd:element>
         <xsd:element name="inQueueSince" type="xsd:long"/>
         <xsd:element name="params" type="xsd:string" minOccurs="0"/>
         <xsd:element name="stuck" type="xsd:boolean"/>
         <xsd:element name="task" type="xsd:anyType" minOccurs="0">
          <xsd:annotation>
           <xsd:documentation>Project to be built.</xsd:documentation>
          </xsd:annotation>
         </xsd:element>
         <xsd:element name="why" type="xsd:string" minOccurs="0"/>
        </xsd:sequence>
       </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.Actionable">
      <xsd:sequence>
       <xsd:element name="action" type="xsd:anyType" minOccurs="0"
                    maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.JobProperty">
      <xsd:sequence/>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.HealthReport">
      <xsd:sequence>
       <xsd:element name="description" type="xsd:string" minOccurs="0"/>
       <xsd:element name="iconUrl" type="xsd:string" minOccurs="0"/>
       <xsd:element name="score" type="xsd:int"/>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.Run">
      <xsd:complexContent>
       <xsd:extension base="hudson.model.Actionable">
        <xsd:sequence>
         <xsd:element name="artifact" type="hudson.model.Run-Artifact" minOccurs="0"
                      maxOccurs="unbounded"/>
         <xsd:element name="building" type="xsd:boolean"/>
         <xsd:element name="description" type="xsd:string" minOccurs="0"/>
         <xsd:element name="duration" type="xsd:long"/>
         <xsd:element name="fullDisplayName" type="xsd:string" minOccurs="0"/>
         <xsd:element name="id" type="xsd:string" minOccurs="0"/>
         <xsd:element name="keepLog" type="xsd:boolean"/>
         <xsd:element name="number" type="xsd:int"/>
         <xsd:element name="result" type="xsd:anyType" minOccurs="0"/>
         <xsd:element name="timestamp" type="xsd:long" minOccurs="0"/>
         <xsd:element name="url" type="xsd:string" minOccurs="0"/>
        </xsd:sequence>
       </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.Run-Artifact">
      <xsd:sequence>
       <xsd:element name="displayPath" type="xsd:string" minOccurs="0"/>
       <xsd:element name="fileName" type="xsd:string" minOccurs="0"/>
       <xsd:element name="relativePath" type="xsd:string" minOccurs="0">
        <xsd:annotation>
         <xsd:documentation>Relative path name from {@link Run#getArtifactsDir()}</xsd:documentation>
        </xsd:annotation>
       </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="hudson.model.AbstractItem">
      <xsd:complexContent>
       <xsd:extension base="hudson.model.Actionable">
        <xsd:sequence>
         <xsd:element name="description" type="xsd:string" minOccurs="0"/>
         <xsd:element name="displayName" type="xsd:string" minOccurs="0"/>
         <xsd:element name="name" type="xsd:string" minOccurs="0"/>
         <xsd:element name="url" type="xsd:string" minOccurs="0"/>
        </xsd:sequence>
       </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="hudson.model.BallColor">
      <xsd:restriction base="xsd:string">
       <xsd:enumeration value="red"/>
       <xsd:enumeration value="red_anime"/>
       <xsd:enumeration value="yellow"/>
       <xsd:enumeration value="yellow_anime"/>
       <xsd:enumeration value="green"/>
       <xsd:enumeration value="green_anime"/>
       <xsd:enumeration value="blue"/>
       <xsd:enumeration value="blue_anime"/>
       <xsd:enumeration value="grey"/>
       <xsd:enumeration value="grey_anime"/>
       <xsd:enumeration value="disabled"/>
       <xsd:enumeration value="disabled_anime"/>
       <xsd:enumeration value="aborted"/>
       <xsd:enumeration value="aborted_anime"/>
      </xsd:restriction>
    </xsd:simpleType>
    </xsd:schema>
    Config.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <project>
      <actions/>
      <description>Sample job ..</description>
      <project-properties class="java.util.concurrent.ConcurrentHashMap">
        <entry>
          <string>hudson-plugins-disk_usage-DiskUsageProperty</string>
          <base-property>
            <originalValue class="hudson.plugins.disk_usage.DiskUsageProperty"/>
            <propertyOverridden>false</propertyOverridden>
          </base-property>
        </entry>
        <entry>
          <string>jdk</string>
          <string-property>
            <originalValue class="string">(Inherit From Job)</originalValue>
            <propertyOverridden>false</propertyOverridden>
          </string-property>
        </entry>
        <entry>
          <string>scm</string>
          <scm-property>
            <originalValue class="hudson.scm.NullSCM"/>
            <propertyOverridden>false</propertyOverridden>
          </scm-property>
        </entry>
      </project-properties>
      <keepDependencies>false</keepDependencies>
      <creationTime>1402648240275</creationTime>
      <properties/>
      <cascadingChildrenNames class="java.util.concurrent.CopyOnWriteArraySet"/>
      <cascading-job-properties class="java.util.concurrent.CopyOnWriteArraySet">
        <string>hudson-plugins-batch_task-BatchTaskProperty</string>
        <string>hudson-plugins-disk_usage-DiskUsageProperty</string>
        <string>hudson-plugins-jira-JiraProjectProperty</string>
        <string>org-hudsonci-plugins-snapshotmonitor-WatchedDependenciesProperty</string>
        <string>hudson-plugins-promoted_builds-JobPropertyImpl</string>
      </cascading-job-properties>
      <scm class="hudson.scm.NullSCM"/>
      <canRoam>false</canRoam>
      <disabled>false</disabled>
      <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
      <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
      <concurrentBuild>false</concurrentBuild>
      <cleanWorkspaceRequired>false</cleanWorkspaceRequired>
    </project>
    the file generated by JAXB are
    com\model\HudsonModelAbstractItem.java
    com\model\HudsonModelAbstractProject.java
    com\model\HudsonModelActionable.java
    com\model\HudsonModelBallColor.java
    com\model\HudsonModelBaseBuildableProject.java
    com\model\HudsonModelFreeStyleProject.java
    com\model\HudsonModelHealthReport.java
    com\model\HudsonModelJob.java
    com\model\HudsonModelJobProperty.java
    com\model\HudsonModelProject.java
    com\model\HudsonModelQueueItem.java
    com\model\HudsonModelRun.java
    com\model\HudsonModelRunArtifact.java
    com\model\HudsonScmRepositoryBrowser.java
    com\model\HudsonScmSCM.java
    com\model\ObjectFactory.java
    Any help will be appreciated .
    Thanks in advance

    Unmarshal the config.xml to Java object.
    Basic JAXB Examples - The Java EE 5 Tutorial

  • How to convert XML to Java Object

    Hello:
    I would like to convert an XML doucment into an object, but I having alot of trouble doing this.
    here is the document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Marketing_Programs>
    <Marketing_Program>
    <rateCode type="String">A</rateCode>
    <plan type="String">AAA/CAA</plan>
    <flatRate type="double">0.0</flatRate>
    <discountRate type="double">10.0</discountRate>
    </Marketing_Program>
    <Marketing_Program>
    <rateCode type="String">B</rateCode>
    <plan type="String">Business Rate</plan>
    <flatRate type="double">0.0</flatRate>
    <discountRate type="double">5.0</discountRate>
    </Marketing_Program>
    </Marketing_Programs>
    A Marketing_Program class exists and so I want to create multiple Marketing_Program objects and store it in hashmap. I'm pretty much stuck on XML to object conversion due to lack of knowledge on converting string to the appropriate datatype.
    Any help would be greatly appreciated!
    Thanks in advance!
    Peter

    using jaxb, castor, jox...
    [email protected]

  • How to convert XML into idocs and post in ECC using PI

    Hello All,
    I want to configure the scenario like this MDM->PI->ECC. Using FTP I am getting able to fetch the xml file from MDM Server Ready folder. Now, I need to convert this XML file into Idocs and post it in ECC. Can anyone provide me step by step configuration in PI to achieve this. I have configured communication channel with adapter type Idoc in Itegration Builder. But, I am not sure where it will do the conversion of XML into Idoc and how do post it to ECC. I am working first time on PI 7.1. I have worked on XI 3.0 in 2006-2007. Any help to configure this step by step shall be appreciated.
    Thanks & Regards,
    Hemal

    In you have the XML from MDM you have to use the mapping provided by the funtionals in the Funtional specification documents. once you did it you must configure the Receiver IDoc Adapter. and later dont fonget to configure properly the ReceiverAgreement.
    as you receive the docuement from MDM via FTP, thats not a SAP System that means that you have to define PI as the sender of the IDoc,otherwise you will have the Error "Unable to convert the sender service to an ALE logical system"
    to do that in the receiver Agreement>Header Mapping>Sender System-->Select PI server.
    Take in mind to send IDocs to any SAP System, the system that send it must be a SAP system too. thats why you configure it
    http://help.sap.com/saphelp_nw04/helpdata/en/5d/112d20f6ce6c46ba66afb98d278fbd/frameset.htm
    Another thing is you have configure the ALE distribution Model.
    se this:
    http://wiki.sdn.sap.com/wiki/display/XI/FileToIDOC
    /people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system
    /people/venugopalarao.immadisetty/blog/2007/01/24/troubleshooting-file-to-idoc-scenario-in-xi
    Let us know
    Rodrigo P-.

  • Convert XML into XSL

    Hi,
    Recently, I got converted query into an XML file, but when I
    try to convert this XML file to XSL file in Dreamweaver. It doesn't
    work. It said "An exception occurred! Type:UTFDataFormatException,
    Message:invalid byte 2 (n) of a 3-byte sequence.(1,1). What happed?
    Thanks in advance!

    Closed (no answer)

  • How to convert XML into word doc or pdf

    hi all ,
    i ve to create a xml with specified alignment,but while taking print out alignments changing according to IE's alignment.
    So, Plz some one tel me whether any solution is there in xml itself or it have to be convert into word doc or PDF.If so, tell me an idea for how to convert xml file into Word doc or PDF.

    thanx ,i saw about FOP in xml.apache.org site and i learned something abt tat . But i dont know how to download FOP package from apache..
    Actually they gave links to download
    like http://ftp.wayne.edu/apache/xml/fop
    inside tat link they mentioned as parent,Directory,binaries,sources and tar files.From this i dont know how to download?
    Plz can someone tell a solution..

  • How to convert XML into XSD Using Altova XML Spy

    Hi,
    How to convert XML file into XSD Using Altova XML Spy.
    I want to use that XSD as an External Def in my IR
    Regards
    Suman

    hi
    Following is the path where you could get the PDF's and zip file.
    https://www.sdn.sap.com/irj/sdn/howtoguides?rid=/webcontent/uuid/5024a59a-4276-2910-7580-f52eb789194b [original link is broken]
    please check out the following Heading, and at the bottom corner you will find the download option where you will get the zip file:
    How to Generate XSD Schemas from Existing MDM 5.5 Repositories
    You can download xomlite45.jar from sdn
    copy the jar file to your java installation location like c:>java in
    Java –jar xomLite45.jar MyFile.xml
    then you get correspondig MyFile.xsd
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bf0e8a97-0d01-0010-f0a2-af3b18b7f4eb

  • How to convert bytes[] into File object

    hi
    how to convert byte array into File object
    pls.. help me
    Regards
    srinu

    rrrr007 wrote:
    Hi,
    How to convert bytes[] into multipage File object?? ]There's no such thing as a "multipage File object." You ought to re-read this thread closely, and read the [API docs for File|http://java.sun.com/javase/6/docs/api/java/io/File.html] to clear up your confusion about what a File object is.
    I used the java.io.SequenceInputStream to concatenate two input streams (basically .pdf files) into a single input stream. I need to create a single multipage pdf file using this input stream. Then you need a pdf API, like iText or fop. You can't just concatenate pdf files, word docs, excel sheets, etc., like you can text files. Google for java pdf api.

  • How to get xml into java object

    yo
    i want to get the xml doc into some object like Document
    i have downloaded code:
    public class Echo extends org.xml.sax.helpers.DefaultHandler
    this class compiles fine but when i instantiate the class in code i get:
    "Exception in thread 'main' java.lang.NoClassDefFoundError: org/xml/sax/helpers/DefaultHandler"
    Please, what does this mean and how do i get this to recognise that i want to use a specific parser
    thanks a lot

    You are probably not specifying the XML jar files (xalan.jar & xerces.jar) on the run line. What is the command you are using?
    Actually, which "jars" you use is dependent on which version of the XML Java release you downloaded (Winter or Fall).

  • XSLT to convert XML into Tables

    Hi,
    I'm trying to import my XML data into a table format. After adding an XSL file to my Structure Application as a Preprocessing Stylesheet, and importing my XML instance file with the Template file opened, the "Unknown File Type" error window appeared asking for a file format to Convert From. Picking any one doesn't create a table.
    The XSL file tranforms the XML data into an HTML file that has a table with columns corresponding to the XML data. I was thinking using that type of XSL because it renders tables.
    Below is the XSL markup:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
      <html>
      <body>
      <h2>Products</h2>
        <table border="1">
          <tr bgcolor="#9acd32">
            <th>Title</th>
            <th>Number</th>
            <th>Date</th>
          </tr>
          <xsl:for-each select="Products/Product">
          <tr>
            <td><xsl:value-of select="Title"/></td>
            <td><xsl:value-of select="Number"/></td>
            <td><xsl:value-of select="Date"/></td>
          </tr>
          </xsl:for-each>
        </table>
      </body>
      </html>
    </xsl:template>
    </xsl:stylesheet>
    Title, Number, and Date are child elements of the Product element, which is a child element of the Products root element in my XML file.
    Am I applying the stylesheet correctly here? Am I using the write kind of stylesheet?
    Thanks,
    zeb

    Hi Michael, Van,
    Thank you for responding to my post. Your feedback was very helpful!
    I was able to get the table to generate in FrameMaker but no data from the XML file is flowing into it. All that appears is the header row with "Title," "Number," and "Date" in the cells, and a row with blank cells underneath it. The Structure View pane has a red "<no value>" for the "Cols" and "Widths" attributes of the Table element. Only the Title column is affected by the width value.
    The XSL, RW, and EDD files are as a follows: (The structure for the XML is a "Products" root element with mulitple "Product" child elements that each have a "Title," "Name," "Date" child element.)
    ==========================XSL==================
    <xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" doctype-system="products_DTD3.dtd" />
    <xsl:template match="/">
    <products>
    <Table cols="3" width="150">
    <TableHeading>
        <TableRow>
            <TableCell>Title</TableCell>
            <TableCell>Number</TableCell>
            <TableCell>Date</TableCell>
        </TableRow>
    </TableHeading>
    <TableBody>
    <TableRow>
    <TableCell><xsl:for-each select="Products/Product"><xsl:value-of select="Title"/></xsl:for-each></TableCell>
    <TableCell><xsl:for-each select="Products/Product"><xsl:value-of select="Number"/></xsl:for-each></TableCell>
    <TableCell><xsl:for-each select="Products/Product"><xsl:value-of select="Date"/></xsl:for-each></TableCell>
    </TableRow>
    </TableBody>
    </Table>
    </products>
    </xsl:template>
    </xsl:stylesheet>
    ==========================EDD==================
    Element (Container): products
    General rule:    Table
    Valid as the highest-level element.
    Element (Table): Table
    General rule:    TableHeading,TableBody
    Attribute list
    Name: cols     String     Required
    Name: width     String     Required
    Element (Table Heading): TableHeading
    General rule:    TableRow
    Element (Table Row): TableRow
    General rule:    TableCell+
    Element (Table Cell): TableCell
    General rule:    <TEXT>
    Element (Table Body): TableBody
    General rule:    TableRow
    ==========================RW===================
    fm version is "10.0";
    element "Table" {
      is fm table element;
      attribute "cols" is fm property columns;
      attribute "width" is fm property column widths;
    element "TableRow" is fm table row element;
    element "TableHeading" is fm table heading element;
    element "TableBody" is fm table body element;
    element "TableCell" is fm table cell element;
    ===============================================
    I'm having trouble placing the "<xsl:for-each select="Products/Product">" tag in the XSL file. When I put it under  TRow, FrameMaker  gives an error that "TRow is not a valid for content (TCell)+". Only when I place it within the TCell tags (as I have above) does the above-mentioned Table with a Header row and a row with empty cells generate.
    Is the XSL the problem here?
    Thanks,
    Zeb

  • Converting XML to Java Objects...possible?

    Hi, Am a newbie to JAXB. As far as I read, JAXB has facility to convert "XSD" (not XML) to Java "classes" (not objects). This can be done using xjc compiler. Can XML files (i.e. ones with data) be converted to Java objects (retaining the data from XML files)? If yes, please throw some light on how it can be done. If no, then is there some java technology to do such a thing?
    Thanks.

    http://xmlbeans.apache.org/

  • Converting textframes into anchored objects

    Hi All,
    I'm generating the ePub files from the InDesign and found that some of my textframes which are in separate stories are captured at the end of the files, but I'd like to have them at the exact position. But when those frames are capturing manually as anchored objects, it looks fine. Please confirm how this can be achieved either scripting or other method?
    Thanks,
    Praveen

    @Praveen – the first question you have to answer to yourself is:
    is there a general prescribe where to anchor exactly a single text frame in the main story?
    If you cannot say that in a general, logical way, you cannot automate this task.
    Or you have to programme a lot of exceptions, that it would be easier to do it manually.
    For InDesign CS5.5 and above it is very easy to anchor a text frame using the UI with two clicks per instance. Scripting those is a more complex task.
    1. You have to identify separate text frames (you can only anchor single, non-threaded ones!).
    2. Perhaps you have to identify a geometrical relation between the single text frame and the main story in form of a single insertion point at the beginning or end of a paragraph…).
    3. And you have to define some properties for the anchor behaviour of the stray text frame you want to anchor.
    How many stray text frames do you have?
    How many documents where you want to anchor those?
    Describe the projected time for the task if done in the UI…
    Is it reliable using a script at all?
    Taking into account that writing (20%) and testing (80%) a script for this task would take some hours to perhaps a day… Plus the time for analyzing the original documents (special cases may be a hurdle one cannot overcome).
    Uwe

  • How To Convert XML into String?

    Hi,
    I have a requirement in which I need to convert the data from XML file to string.
    E.g.
       <Drawing>
          <DrawingSpecification>
             <Header>
                <SoldTo>SDN</SoldTo>
                <SoldToName>SAP</SoldToName>
                <Date/>
                <Manager>CEO</Manager>
                < Plant>INDIA</Name>
                <Items>
                   <Item>
                       < MaterialNumber>MatNum12</ MaterialNumber>
                       <ProductNumber>ProName12</ ProductNumber>
                   </Item>
               </Items>
               < ClientId>ClientID123</ ClientId>
               <FileName>FileName123</FileName>
               <Type/>
               < TemplateName/>
          </DrawingSpecification>
          <Image contentType=""/>
       < /Drawing>
    Output should be like:
       < File>
          < Content> SDN SAP CEO INDIA MatNum12 ProName12 ClientID123 FileName123</Content>
       < /File>
    Please provide solution for the same.
    Thanks,
    Abhishek.

    what about something like this
    package test;
    import java.io.File;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class Test {
         public static void main(String args[]) throws Exception {
              DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
              DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
              Document doc = docBuilder.parse(new File("test.xml"));
              StringBuffer buffer = new StringBuffer();
              appendChildren(buffer, doc.getChildNodes());
              System.out.println(buffer.toString());
         private static void appendChildren(StringBuffer buffer, NodeList list) {
              for (int i = 0; i < list.getLength(); i++) {
                   Node node = list.item(i);
                   if (node.getNodeValue() != null) {
                        if (node.getNodeValue().trim().length() > 0) {
                             buffer.append(node.getNodeValue()).append("|");
                   appendChildren(buffer, node.getChildNodes());
    ...btw: IMHO the use of this forum is to get an answer to an particular question - not to ask for complete solutions - create the solution yourself an ask if you are stuck somewhere (with a bit of research (google) it is not hard to find a solution for your problem)
    regards franz
    ...close thread if question is answered

Maybe you are looking for

  • Installation problem on 5800

    Hi, I cant seem to install anything on my 5800XpressMusic for a sudden, it keep saying "Unable to perfom the operation, another operation is in progress" when I try to install any application, I dont have any other progress in use, why does it keep s

  • Api's for payables open interface

    what are the API's that are used in payables open interface????

  • Need to add horsepower to Power PC G5 (can't afford an Intel one yet)

    Hello all. In the ideal world I would buy a new Intel based Mac. Right now I can't afford it nor the cost of replacing all the software. So I must make do with what I have. However, I would like to get the most out of it and so I'm wondering of the g

  • How do I install snow leopard 10.6 to upgrade 10.5.8?

    I have version 10.5.8. I purchased snow leopard 10.6 but when I received the disc, it was version 10.6.3 and when I tried to install it, it said that I do not have the volume to do it. How do I buy version 10.6 and install it?? Please help?

  • Importing via network connection

    I have hundreds of albums that were saved to DVDs many years ago using iTunes version 4 or 5. These files were saved as mp4a files. My new iMac seems to have difficulty reading these DVD's so I've begun loading them onto my son's ext. HDD (via Window