XML Content and Linked containers

Hi, I just downloaded the trial of CS5 and I was wondering how to do the following.
I have 5 XML files that load into my site.  Each one is called by a button click.  On the initial stage I have 2 containers which are linked for overflow text.  So here is my problem.  When I click on any button the content in the second text box stays there and only the content of the first one changes.
SO question...
How do i get the new text that is loaded from the XML to flow to the second container? OR the second container clear its content if there is no overflow?
Thanks so much!!
Kathy

HI and thanks so much for responding!  So I added everything I THINK I need to add and its still not updating them.  This is my first time trying this so I'm not sure if my code is correct but here is the code.  The two containers I have on the stage are m_txt and o_txt.  Thanks so much for your help!
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flashx.textLayout.compose.StandardFlowComposer;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.elements.TextFlow;
import flash.external.ExternalInterface;
import flash.display.StageScaleMode;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
//Preloader code start
var i : uint = this.numChildren;
for (; i > 0; i--) this.getChildAt(i - 1).alpha = 0.0;
var tf : TextField = new TextField;
tf.text = "Now loading...";
tf.width = 1000;
addChild (tf);
// Preloader initialization done. If you don't like it, decomment the next line
//removeChild (tf);
var uarray : Array = ["home.xml","about.xml","philosophy.xml","contact.xml"];
var harray : Array = [];
var marray : Array = [];
var qarray : Array = [];
var barray : Array = [];
i = uarray.length - 1;
var uloader : URLLoader = new URLLoader;
uloader.addEventListener ("complete", completeLoaderChain);
uloader.load (new URLRequest(uarray[i]));
function completeLoaderChain (e:*) : void
    var d : XML = XML(e.target.data);
    harray[i] = d.head;
    marray[i] = d.main;
    qarray[i] = d.quote;
        if (i-- == 0) enableButtons();
        else uloader.load (new URLRequest(uarray[i]));
function enableButtons () : void
    i = this.numChildren;
    for (; i > 0; i--) this.getChildAt(i - 1).alpha = 1.0;
    if (this.contains (tf)) removeChild (tf);
    barray[0] = home_btn;
    home_btn.addEventListener ("click", buttonClicked);
    barray[1] = about_btn;
    about_btn.addEventListener ("click", buttonClicked);
    barray[2] = philosophy_btn;
    philosophy_btn.addEventListener ("click", buttonClicked);
    barray[3] = contact_btn;
    contact_btn.addEventListener ("click", buttonClicked);
function buttonClicked (e:*) : void
     var textFlow:TextFlow;
     var m_txt:ContainerController = new ContainerController(m_txt)
     var o_txt:ContainerController = new ContainerController(o_txt);
// import the text flow from XML using TextConverter and assign a StandardFlowComposer
     textFlow = TextConverter.importToFlow(uarray[id], TextConverter.TEXT_LAYOUT_FORMAT);
     textFlow.flowComposer = new StandardFlowComposer();
    var id : int = -1;
    for (var l = 0; l < barray.length; l++) {
        if (barray[l] == e.target) {
            id = l;
            l = barray.length;
     textFlow.flowComposer.addController(m_txt);
    textFlow.flowComposer.addController(o_txt);
    h_txt.text = harray[id];
    m_txt = marray[id];
    q_txt.text = qarray[id];
     textFlow.flowComposer.updateAllControllers();
     //The following two lines will call a JavaScript function "resizeh"         
     /*var resizeto:Number = m_txt.height + m_txt.y ;
     if( resizeto < 550){
          resizeto = 550;          
          ExternalInterface.call("resizeh", resizeto);
     } else {
          ExternalInterface.call("resizeh", resizeto);
/CODE

Similar Messages

  • Pass parameter through standard page "import xml content and actions"

    Dear Portal experts,
    As you know, a standard portal page is configured to allow the import of XML file. It is located in the portal in the path system admin -> transport -> xml content and actions -> import
    I configured a quick link u201Cimportu201D to the page so now the link http://myserver:port/irj/portal/import allows me to access directly to this screen.
    What I would like to do now is to pass the parameter related to u201Cfile nameu201D through this screen meaning that I would like that http://myserver:port/irj/portal/ import/filename=C:\test.xml  fills automatically the fields u201CXML fileu201D with  C:\test.xml 
    Please do you know how to achieve this ?
    Thank you very much and regards

    hi,
    @Maksim :
    When user launch an URL like http://myserver:port/irj/portal/ import/*filename=C:\test.xml, he is requested to provide username and password; as this link is a shortcut for the upload xml page, there is a check of authorization and only portal admin that have authorization and permission on this page/iview will be able to upload xml file through the URL. Hope this clarify.
    @Kumar :
    thank you for your answer. What a pity to not be able to pass parameter through standard portal page/iview particularly knowing that we can pass paramater through many kinds of iviews (transactional iview, url iview, VC iview...). I explored some option on file com.sap.portal.ivs.init.par but this was unsuccessful. However, thanks to this [link bellow|http://wiki.sdn.sap.com/wiki/display/Snippets/ComponenttouploadXMLfilewithPCD+objects], I was able to upload through URL the XML file.
    The problem is that I can upload only XML file that are stored in the server not in the local user computer. My requirement is to be able to upload local XML file stored on user's computer.
    If someone could provide and idea/solution, I would be very grateful.
    Cheers

  • Issues with XML Content and Actions to import RRA in FPN (EP7 SPS13)

    Hi,
    I am having trouble using the import functionality of XML Content and Actions to transport Remote Role Assignments between Consumer Portals. Whenever I want to upload an XML file containing RRA for Roles and Groups that were already assigned to eachother, the import fails and nothing is updated. The error I get:
    UMException. Data could not commit to Role: gp:/[full ID of portal role]
    Anyone with experience in how to use this?
    Kind regards,
    Christian Staalby

    hi,
    @Maksim :
    When user launch an URL like http://myserver:port/irj/portal/ import/*filename=C:\test.xml, he is requested to provide username and password; as this link is a shortcut for the upload xml page, there is a check of authorization and only portal admin that have authorization and permission on this page/iview will be able to upload xml file through the URL. Hope this clarify.
    @Kumar :
    thank you for your answer. What a pity to not be able to pass parameter through standard portal page/iview particularly knowing that we can pass paramater through many kinds of iviews (transactional iview, url iview, VC iview...). I explored some option on file com.sap.portal.ivs.init.par but this was unsuccessful. However, thanks to this [link bellow|http://wiki.sdn.sap.com/wiki/display/Snippets/ComponenttouploadXMLfilewithPCD+objects], I was able to upload through URL the XML file.
    The problem is that I can upload only XML file that are stored in the server not in the local user computer. My requirement is to be able to upload local XML file stored on user's computer.
    If someone could provide and idea/solution, I would be very grateful.
    Cheers

  • Import of XML file failed in portal using XML Content and Action

    Hi Friends,
    I am trying to import the simple XML file which is just creating the folder in the PORTAL_CONTENT using XML CONTENT AND ACTIONS  which is one way of creating the portal content. GO TO SYSTEM ADMINISTRATION > TRANSPORT > XML CONTENT AND ACTIONS > IMPORT.
    The reason for using this import tool is to upload the backend Business roles, which is not not working on our corporate portal. To test the import functionality I used the following xml file (I got this XML file by exporting the test folder in the portal using the same tool)
    <GenericCreator author="XML Creator" version="XML Automatic Creation" mode="clean,execute" report.level="success" createMode="1" default.locale="en" ignore="false">
    <Context name="portal_content" objectClass="com.sap.portal.pcd.gl.GlContext"></Context>     <Property name="parent1" value="pcd:portal_content"/>
         <Context name="com.dri.fldr.im" objectClass="com.sap.portal.pcd.gl.GlContext" create_as="0" parent="$">
              <Attributes>
                   <Attribute name="com.sap.portal.pcm.Description" type="text">
                        <AttributeValue value="" locale=""/>
                        <Attribute name="administration" type="string">
                             <AttributeValue value=""/>
                        </Attribute>
                        <Attribute name="Inheritance" type="string">
                             <AttributeValue value="NONFINAL"/>
                        </Attribute>
                   </Attribute>
                   <Attribute name="com.sap.portal.pcm.Title" type="text">
                        <AttributeValue value="test" locale=""/>
                        <AttributeValue value="test" locale="en"/>
                        <Attribute name="administration" type="string">
                             <AttributeValue value=""/>
                        </Attribute>
                        <Attribute name="mandatory" type="string">
                             <AttributeValue value="true"/>
                        </Attribute>
                        <Attribute name="Inheritance" type="string">
                             <AttributeValue value="NONFINAL"/>
                        </Attribute>
                   </Attribute>
              </Attributes>
         </Context>
    </GenericCreator>
    SDN BLOCKED THE XML The above XML file works fine in other portal in the landscape but not in corporate portal ( which is freshly build recently).Following error message is display when i am trying to upload the file
    Status Name Action Type Comment
    General Extracting root node E:\usr\sap\EPD\JC00\j2ee\cluster\server0\%USERPROFILE%\AppData\Local\Temp\tmp_masscontent4135391959047431276.xml Failed to extract root node
    General Extracting root node E:\usr\sap\EPD\JC00\j2ee\cluster\server0\%USERPROFILE%\AppData\Local\Temp\tmp_masscontent4135391959047431276.xml Parsing failed .
    Dont know is there a service/ configurations needs to be done to enable this feature?.
    Thanks
    Edited by: hammad on Sep 4, 2009 5:48 PM
    Edited by: hammad on Sep 4, 2009 5:49 PM

    The problem statement is not very clear.
    Try following this how to guide [https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/207a2141-c870-2910-e080-90c920b24f47&overridelayout=true|How-To]
    Best Regards,
    Prasanna K

  • FCP XML import and linking .r3d

    I have a sequence that was originally edited in FCP (7.0) using ProRes proxies created out of RedCine. I remember that in Premiere 5.5 when you imported the XML, premiere re-linked the original .r3d's with all the scale and position attributes.
    When I import the XML into Premiere CC it doesn't reconnect the .r3d files.
    Did something change with CC or is there something wrong with the XML?

    Thank you all for your help. It still leaves a bit of a workflow problem. <br /><br />Basically we have some people ingesting / organizing content and maintaining on a network share. Duplicating the media is slow and moving it all into one volume is not too good either as it breaks all the relationships for others. Re-linking is good, but doesn't work if the material is spread across subdirectories and giving a key to link all the media together looses some of the benefit of having the export from FCP in the first place, it's just as easy to re-make the edit.<br /><br />We are only using cut edits, so this is quite simple. For users on the Mac using FCP and handing off to Premier it works fine, the problem is we want to hand off to Windows Premier. It's ok to run a script over the files to change the XML naming of the <pathurl> which seems to be causing the problem, but how to describe this in the Windows world?<br /><br />Thanks for all the help.... anyone from Adobe with any ideas?<br /><br />The problem as I see it is how to identify Mac OS mounts to a Windows version of Premier on XML import.

  • XML Content Editing - link disappeared

    Greetings,
    We have recently upgraded our portal from SP11 to SP19, and several KM functionalities changed.
    Beforehand we had an "edit" link while displaying XML forms (left bottom corner), and clicking the link opened an XML editor for that specific document.
    I am 99% sure that this is one of settings under /etc/xmlforms/... folders, which was overwritten during the upgrade, and that this link appeared in SP11 becuase of customization.
    Did anyone ever had to implement such a functionality?
    Thanks in advance!

    Hi Ivan,
    In my opinion this upgrade should not affect on your customized  xml form or KM content. But if in upgrade the template is deleted or overwritten by transporting the old data then your expected result will hamper.
    As you are mentioning about  "/etc/xmlforms/.." folder structure; it is a folder in which actual xml code of your xml form template is stored & we don't  have to do any changes here.
    If you have created edit button functionality  in your code then just look it again. And if you have made provision of it in xml form only then check it the form again & add the ' edit ' functionality by opening it in xml form builder.Or transport the (backup) old xml form templates again by ice package.

  • Can I create a custom table of contents and link to other .pdf files based on responses to a form?

    Hey Everyone! First post ever, so bear with me:
    I'm trying to create a streamlined method to use a form  to let myself and others add information and select certain options to put together a custom table of contents. Basically, I would like to have a form with a series of text fill and single/multiple choice options that will automatically populate a table of contents based on the selections and will link to other .pdf files that are associated with the selections. I was hoping this would be possible with a form, but I'm relatively new to the function of the software as a whole and my research came up short. Any suggestions on how to start are more than welcome, and if I wasn't quite clear enough I would be happy to elaborate.
    Thanks for your time!

    You would need to search for other PDF creation software that can accomplish what you desire.
    There are many cheaper  PDF creation alternatives other than Adobe's Acrobat Pro software.
    Also, try doing a web search under these terms to see if you can find an app/software/solution that may work for you.
    How to create table of contents in PDF files

  • IBooks support for auxiliary content and linking?

    I have a couple of questions for the iPad/iBooks owners out there that I hope can answer them for me. I'm in Canada, so I won't be getting an iPad for at least another month or more (also waiting for the 3G), and I don't have any readily available access to one to try for myself.
    1) This is a bit technical, but I'll just come right out and ask it. How is iBooks support for auxiliary content (non-linear content documents, in ePub parlance)? Does it do anything special with it (pop-ups, tooltips, side bars, slide-out panels, etc...), or does it just ignore it and lump it in with the rest of the "real" content?
    From a cursory glance, it looks like Microsoft has done something similar with their proprietary .LIT ebooks (which are apparently based roughly on the same specs as ePub, i.e. XHTML and CSS). But I get the feeling this functionality has gone the way of multi-angle DVDs, which is to say no one bothers with it.
    2) And my next question comes from having tried various ePub readers on the iPhone. None, but Stanza seem to even get this remotely correct (some completely ignore them, some render them but don't do anything with them, and one attempts to do something with them but spits out errors). I have an ePub that uses footnotes heavily (in the dead-tree version they're footnotes, in the ePub they're essentially endnotes). The ePub in question doesn't have chapters, but it has been broken up into multiple chunks (multiple XHTML content documents behind the scenes). The footnotes are accomplished by linking (and back-linking) a la standard HTML hrefs between said chunks. I assume iBooks is Webkit-based and this isn't a problem at all (i.e. it's just like using a web browser in that regard)? Also, am I correct that there's no "back" button/function except in the TOC?
    3) Based on all the PR and guided-tours, etc..., I presume iBooks strictly conforms to a paginated view? There's no scrolling layout/view, and by extension a way to do auto-scrolling?
    4) How does text-to-speech work? Will it read the whole book, or does it only read, for instance, your current selection?
    Thanks!

    Jon Walker wrote:
    How is iBooks support for auxiliary content (non-linear content documents, in ePub parlance)? Does it do anything special with it (pop-ups, tooltips, side bars, slide-out panels, etc...), or does it just ignore it and lump it in with the rest of the "real" content?
    It isn't handled by the reader at all. It is handled by the ePUB generating application. Non-linear content, if included, is usually ordered as found, i.e., it uses a left-most, top-to-bottom ordering algorithm. This usually means it ends up at the end unless aligned to the left edge of the source document above the inline content or interspersed between other non-linear and linear segments if also included. To ensure content displays with associated text, it is normally anchored, inline, just before or just after the desired text. Some generating apps indicate an ability to perform left/right alignments with text wrapping around inline images but I have yet to personally try this.
    You'll have to excuse my ignorance, Jon, but I barely understand anything you wrote just then. I've only been playing with ePubs for the last several days, so I still have a very limited understanding of the specs, and have only a small collection of samples (which are very simply constructed), so I don't know the full breadth of what's possible in ePub. For instance, in my example ePub, one content document ends at the end of a paragraph, and the next document begins at the start of the next paragraph.
    Please correct me if I'm wrong, but my current understanding of "content documents" are that they're essentially XHTML pages, and the only reason they're broken up inside the container is either for semantic reasons, to reduce initial load times, or to support older readers. And basically a reader will load them sequentially when it comes time to display them (i.e. next chapter, via a link, etc...), assuming in the 'spine' section they're listed as being linear (either explicitly or by default).
    The only examples I've seen where a particular 'itemref' has had its 'linear' attribute set to 'no' are things like covers and footnote sections (I believe the IDPF also uses the example of an answerkey in a textbook). I guess it's a two-fold question. I'm having a hard time envisioning what other elements in a book one would want to mark as non-linear. I guess things like a glossary, a table of illustrations, an index, etc... (i.e. stuff that's important to the book, but you wouldn't want to read linearly with the actual content of the book). I should point out I write Windows apps for a living, and have no understanding of how the publishing industry works, or what goes into the making, designing, or laying out a book.
    And second, it seems the specs leave it completely up to the reading device to determine what it wants to do with these non-linear documents. Hence, why I asked how iBooks handles them.
    You lost me when you started talking about edges, anchoring, and wrapping. To me, that sounds more like formatting decisions one would have to make inside an XHTML document. But I'm always open to being schooled on a subject.
    I have an ePub that uses footnotes heavily (in the dead-tree version they're footnotes, in the ePub they're essentially endnotes).
    I believe this is essentially correct. Since ePUB files have no defined pages, the footnotes become endnotes the the specific generating application determining if they display at the end of the book or at the end of the chapter. E.g., Since Adobe InDesign requires segments (cover page, title page, chapters, etc.) be generated as independent documents with are later assembled as a "book," I believe its "endnotes" automatically display at the end of the individual documents which make up the book while other applications use inline tags to break up a single "book" document into independent XHTML documents but place all "endnotes" at the end of the "book" rather than within each XHTML document created from the tagged segment where found in the main source document.
    From what I've seen in the specs, it makes sense that, with the way the specs are at this time, the onus is on the generator to figure out how to use and where to put the footnotes. Without a standard way of defining them, there's no way for a reader device to know what it's looking at is a footnote or not.
    I was just hoping in my heart of hearts that Apple had somehow solved the problem. After all, they were the ones throwing the word "magical" around when describing the iPad.
    As a side note, would you know if iBooks properly supports the page-break-before and page-break-after CSS styles?
    Based on all the PR and guided-tours, etc..., I presume iBooks strictly conforms to a paginated view? There's no scrolling layout/view, and by extension a way to do auto-scrolling?
    I've not found a way to scroll but then I prefer paging through the document with a tap than continuously "swiping" and so have not looked all that hard.
    Yeah, not a dealbreaker by any means. Just something I've started playing with on my iPhone reader, and have kinda started to enjoy. But I'll make sure not to get too comfortable with it now.
    As for the text-to-speech (which I wouldn't use anyway), I guess it's using the VoiceOver APIs that Apple includes in the SDK(?), and, no, it won't automatically read a whole book for you, but it will read at most a page at a time. Apparently, this is their work-around for the same grief that Amazon got with the Kindle's speech feature.

  • MP3 Player, XML, Cover and Link

    Hi,
    i wonder if i can easily creat an MP3 player for my website
    with flex. I need a simple player that shows the cover, band and
    title of the song that is played. the player should start by random
    if the user enters the site. the user is able to skip forward and
    backward and to stop playing. all data comes from an XML file.
    i want the view of the player to be changed if i want to.
    size, color.
    is this easy to do with flex?
    cheers
    denis

    Hi,
    Yes, it is. Please find a sample at the URL below. You will
    find a sample application called Podcast Player. You will find more
    samples.
    http://www.adobe.com/go/as3examples
    Hope this helps.

  • Is Acrobat Pro right for us. We have an Employee Handbook that needs editing. Some is current pdf, some from an older version. Want to get all into one handbook, have the table of contents automatically adjust and link to specific pages from the ToC.

    Is Acrobat Pro right for us. We have an Employee Handbook that needs editing. Some is current pdf, some from an older version. Want to get all into one handbook, have the table of contents automatically adjust and link to specific pages from the ToC.

    You can download the trial version (http://helpx.adobe.com/acrobat/kb/acrobat-downloads.html) to convert the PDF back to WORD if you do not have the original. The conversion may not be perfect, but it is typically better than starting from scratch. You may be lucky and get a good result. You might check the settings (in the save screen) to try retain format versus retain text flow. The format version can be a pain to edit since it creates a bunch of text boxes. The flow version may require you to reformat in WORD, but you likely would want to do that anyway.

  • How Can I Attach and Link an XML file to a 3D Model in a PDF?

    How Can I Attach and Link an XML file to a 3D Model in a PDF?
    What I am trying to do is find out how to have a 3D model and a parts list linked to it within the PDF file.  I would also like to be able to add to the parts list if at all possible once the pdf has been created.  A template to create future PDF's with the 3D model and list might also be useful.
    I am not entirely sure if this is all possible within a PDF file, but I have viewed a PDF (Adidas Trainer) example which has a Excel file attached to it which links to the 3D model.  I have also had a look at partner products such as Lattice, Tetra4D, Anark, which can do animations and all sorts, but frankly it seems a bit overkill for what I am looking to do.
    Please, any help would be appreciated.  Thanks

    AlliCT59 wrote:
    > Shared Object sounds like it would work, but hten agian,
    I'm really stuck!
    >
    > Thanks for any help.
    >
    > Allison
    I wrote about it while ago, let me paste the whole thing.
    This example has simple
    buttons which upon click go to new sites and in the same time
    place record in form
    of *.SOL file on user drive. That record is read when you hit
    the next button and
    based on that the button will be selected as the one last
    clicked.
    You could use the very same thing just instead of suppressing
    button simply gotoAndPlay frame
    to continue the part you need.
    http://groups.google.com/group/macromedia.flash.actionscript/browse_thread/thread/36649453 1f4fd02d/245a57d0cdaa1d29?lnk=st&q=&rnum=3&hl=en#245a57d0cdaa1d29
    The source is in a different place, i re-upload for you :
    http://www.flashfugitive.com/stuff/SharedObj_urlcheck/
    fla file
    http://www.flashfugitive.com/stuff/SharedObj_urlcheck/beentourl.fla
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • HT4623 My iPod Touch is te 4th generation with iOS 4 only... The desktop that it used to connect with was broken and I couldn't update my iPod touch as all content is linked to the iTunes on that broken PC. What should I do?I won't erase all my music reco

    My iPod Touch is te 4th generation with iOS 4 only... The desktop that it used to connect with was broken and I couldn't update my iPod touch as all content is linked to the iTunes on that broken PC. What should I do?I don't want to erase all my music recording. (couldn't back up easily...) my dairy, my financial record made on apps...
    If I got a new Mac book pro soon, would it helps backuping everything?

    awesome121, he does not an an iCloud account. You need iOS 5 or later for iCloud and the poster said he has iOS 4.
    awesome121 wrote:
    DO you have a icloud account?

  • Reading an XML file and write the contents to another xml file in java

    Hi,
    I am new to xml parsing.My requirement is that I am getting a message (xml) using ibm MQ in the ByteArrayInputStream format.I have to read this xml message and write to another file.
    I am creating a POC for this.
    First I used simple reading and writing concept but the output is "java.io.FileInputStream@3e25a5 "
    Sample xml file
    - <Client>
    <ClientId>1234</ClientId>
    <ClientName>STechnology</ClientName>
    <DTU_ID>567</DTU_ID>
    <ClientStatus>ACTIVE</ClientStatus>
    - <LEAccount>
    <ClientLE>678989</ClientLE>
    <LEId>56743</LEId>
    - <Account>
    <AccountNumber>9876543678</AccountNumber>
    </Account>
    </LEAccount>
    - <Service>
    <Cindicator>Y2Y</Cindicator>
    <PrefCode>980</PrefCode>
    <BSCode>876</BSCode>
    <MandatoryContent>MSP</MandatoryContent>
    </Service>
    </Client>
    code:
    import java.io.ByteArrayInputStream;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    public class ByteArrayInputStreamToXml {
         public static void main(String srg[]) throws IOException{
              InputStream inputStream= new FileInputStream("C:\\soft\\test2\\sample1.xml");
              byte currentXMLBytes[] = inputStream.toString().getBytes();
              ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(currentXMLBytes);
              OutputStream out = new FileOutputStream("C:\\soft\\test\\data.xml");
              int read=0;
              byte[] bytes = new byte[1024];
              while((read = byteArrayInputStream.read(bytes))!= -1){
              out.write(bytes, 0, read);
              out.write( '\n' );
              inputStream.close();
              out.flush();
              out.close();
              System.out.println("New file created!");
    Please suggest me how can I use DOM/SAX parser ,I can see several code on net for reading xml file using SAX/DOM parser but writing an xml file after reading it using ByteArrayInputStream I am not getting .A help through some example Link will also be helpful for me.
    Thanks
    Sumit
    Edited by: user8687839 on Apr 30, 2012 2:37 AM
    Edited by: user8687839 on Apr 30, 2012 2:43 AM

    Thanks I got the result.
    package com.sumit.collections;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    public class ByteArrayInputStreamToXml {
         public static void main(String srg[]) throws IOException{
              InputStream inputStream= new FileInputStream("C:\\soft\\test2\\sample1.xml");
              ByteArrayOutputStream buffer = new ByteArrayOutputStream();
              int nRead; byte[] data = new byte[1024];
              while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
              buffer.write(data, 0, nRead); } buffer.flush();
              byte currentXMLBytes[]= buffer.toByteArray();
              /* byte currentXMLBytes[] = inputStream.toString().getBytes();*/
              ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(currentXMLBytes);
              OutputStream out = new FileOutputStream("C:\\soft\\test\\data.xml");
              int read=0;
              byte[] bytes = new byte[1024];
              while((read = byteArrayInputStream.read(bytes))!= -1){
              out.write(bytes, 0, read);
              out.write( '\n' );
              inputStream.close();
              out.flush();
              out.close();
              System.out.println("New file created!");
    }

  • CS5 table of contents broken links and missing bookmarks

    I'm having an issue with the table of contents in a .pdf. I'm working on a 112 page document in InDesign CS5. After exporting the .pdf, I realized that the file would be far too large to upload to the website. I used "reduce file size" in Acrobat Pro to make it smaller and chose the option to make it compatible with Acrobat 5.0 and later. The table of contents worked fine, all bookmarks appeared and links worked but the file was still too big. I did the same thing again but for version 4.0 and later and now the file is an appropriate size but the table of contents doesn't include all of the bookmarks and certain links don't work. Any help is appreciated!

    Don't go down to 4. Consider v5 a minimum. I prefer v7 as a minimum. v4 doesn't support smarty features. Generally, the higher the version number, the more clever it is at squeezing file size. But really, the single biggest factor in PDF file size is your choice of how many ppi the bitmap images are sampled down to. Did you try setting them down to 100 ppi, for example?

  • How do I unlink Ipod from my old PC (which has crashed HDD) and link to new PC without erasing contents of my Ipod?

    How do I unlink Ipod from my old PC (which has crashed HDD) and link to new PC without erasing contents of my Ipod?.  Unfortunately I lost all my content (photos, music) etc from my old PC when it crashed .... but when I try and link my iPod to my new PC it wants to erase the iPod first, which obviously i don't want to do, else I lose all my content ... can anyone help?

    See:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

Maybe you are looking for

  • IPod and iPad mini

    I have and iPad mini but i want to take something into school And I'm not sure whether I should get an iPod touch or nano And the whether it should be 16gb or 32gb Thx FYI my iPad mini is 32gb

  • What's the point of buying a 364XL black cartridge?

    I'm just curious. Since last fall, the 364XL black cartridges (V1) contain less ink than before and are rated at a yield of 550 pages instead of 750* pages, but everywhere I look (in Sweden) they still cost the same. One of the stores I went to had b

  • HT204022 How do you reset photo stream?

    The default setting in iphoto has pushed my entire photo library to the could. Or atleast attempted to. I stopped it before all 30k pictures were uploaded. The problem now is when I turn photo stream back on in icloud it is trying to download 4,300 p

  • Comand line: EUL upgrade error

    Hi All, I am running the following from command line... dis51usr.exe/connect user1/pswd@prod1 /opendb test_ap /sheet test_ap_sheet /batch /export xls c:\carlson\1.xls But It doesn't create the export file output at the given path. If i try to run the

  • Multiple accounts facebook

    Is there a way to get two facebook accounts on the facebook app. if not is there a other app. that i can use for this ? Otherwise apple please make this for the app because there are more people u need this ? thanks. sybmar