Copying Nodes between Documents

Hi everybody,
I have a very strange problem and can�t explain why it occurs.
I�m parsing a valid XML Document, i.e. producing an DOM Document, which I want to filter partially (which works very well). But when I have filtered some Nodes and when I try to add those in another DOM document, which I also read in, the program will stop without throwing an exception!!
That�s my command:
resultDocument.getFirstChild().appendChild(someFilteredNode);
It won�t work...Does anybody know why this happens??
Thanx for any answers!!
Phil

ok, it looks like you use some old parser.
with something "recent", it should work - check:
http://xml.apache.org/xalan-j/apidocs/org/w3c/dom/Document.html#importNode(org.w3c.dom.Node,%20boolean)
or
http://java.sun.com/xml/jaxp/dist/1.1/docs/api/org/w3c/dom/Document.html#importNode(org.w3c.dom.Node,%20boolean)

Similar Messages

  • How can I use DOM to copy Nodes between different XML Document ?

    Can I copy one Node or Element from one XML Document to another Document by DOM ?
    Because I use the Xerces , but it is not work if I want to copy Node between different Document, or I am doing something wrong. Anyone can help me , I will deeply appreciated !!

    check out the importNode() method of Document.

  • Indesign CS6 crashes when copying pages between documents

    I have two documents and I want to copy 28 pages from one to the other. Indesign crashes on any form of attempt. What I tried so far:
    1. Copy pages per drag and drop, ID would then ask where to insert, I selected "at the end". Crash.
    2. Save both documents as IDML, then opened the IDMLs, saved as INDD (to erase possible document structure corruptions), closed and opened both INDDs again, then drag and drop. Crash.
    3. Selected the 28 pages from the source document, selected "Insert pages" from mini menu of pages panel, then set what pages to use, where to put ("At the end") and target (the other document). Crash
    4. Tried both, "Insert pages" and drag 'n drop, with different target position "At the beginning". Crash.
    5. Saved a copy of the source document, reduced it to contain only those 29 pages I want to copy, then drag and drop to target. Crash.
    6. Tried vice versa, means copy all target document's pages to the source document. Crash.
    Any idea how I can get the pages over to the target? There is unfortunately no "Append pages from file" in the mini menu.
    TIA!

    I would try another one with each of these documents.
    Create a new document with 2 pages.
    Name the master pages so, that their names are not conflicting with neither of these 2 document’s masters.
    Delete every style in that empty document, also any swatch
    No drag the pages of the first document into such an empty document.
    Do the same step 1 to 4 with the second document in a NEW empty document.
    Now you have 2 new documents. Take care that no conflicting master names appear.
    In each of these documents create in each style panel a folder and drag all used styles in that folder.
    Save both documents
    Try again to insert the pages of both documents.
    Otherwise, it this does not work out, could you send me via private message the files or a link. I would check it with a Debugging Version of InDesign (InDesign DEV) I can use to find errors.

  • Copy prices between documents assigned to different pricing procedures

    Different pricing procedures are assigned to sales document & Billing document -- however some of the condition types are common in the two procedures-- would the pricing get copied for the those common conditions if the copy control is set to copy (pricing type "G")
    Appreciate your responses.

    Pricing Type = G is to copy the pricing and redetermine taxes so it should based on if that is all in the copy control. We do not have a different pricing procedure for both, we just copy the values from the order and/or the freight document.
    When I have these types of questions, I always run a test order in dev and it answers many questions. Good Luck.

  • How to copy swatches between documents?

    Hi,
    I've been trying for a while to copy all swatches from a document to another. The goal is to create a new document with the same swatches as a source document.
    The most obvious solution to this, would be to use the duplicate command, but I can't seem to get it working properly. Something similar to the following line produces the error "clone not allowed":
    duplicate swatch 1 from doc1 to doc2
    I've have also tried this variant:
    repeat with i from 1 to count of doc1's swatches
         set swatchProperties to properties of swatch i of doc1
         set swatchProperties's container to doc2
         make new swatch in doc2 with properties sProp
    end repeat
    This oddly enough works in the first iteration, but then spits out the error: "Adobe Illustrator got an error: Invalid type".
    I thought this would be an easy task, and I still believe it somehow is and I'm just doing it wrong.
    Anyone?
    Thanks

    OK,
    Now I actually managed to do it:
    repeat with i from 1 to count of doc1's swatches
         set newSwatch to make new swatch in doc2
         set newSwatch's name to (name of swatch i of doc1) as string
         set newSwatch's color to color of swatch i of doc1
    end repeat
    It would it still be nice though if someone could tell me how to use the duplicate command.
    Thanks

  • Copy pages between documents

    Hello there,
    I'm trying to compile a final .indd file based on different documents pages. To do that, i'm loading a XML file with the names of the files I need and the page I need .
    exemple of my XML:
    <files>
         <file url="firstDoc.indd" page="2" />
          <file url="secDoc.indd" page="5" />
         <file url="thirdDoc.indd" page="1" />
    </files>
    There is no probleme to load that XML and parse it. I can open the file and get the right page, but I don't know how can I copy these pages in a single new document.
    Is there any copy function ? or move function ? that can do that easily ?
    I've got a function like that for now:
    var myDocument = app.documents.add();
    for(var i=0;i<(xml.file.length()-1);i++){
         var address = xml.file[i].attribute("url");
         var myMod = app.open(File(idFileFolder+"/" + address), false);
         var myPage = myMod.pages[xml.file[i].attribute("page")];
         myMod.close(SaveOptions.no);
    If someone have an advice or a part of a script, I'll be really thankfull.
    Cheers.
    Gael

    This should get you started:
    if(app.documents.length < 2) {
        alert("Must have two open documents");
        exit();
    var myDocOne = app.documents[0];
    var myDocTwo = app.documents[1];
    var myPage = myDocOne.pages[0];
    myPage.duplicate(LocationOptions.AT_END, myDocTwo.pages.lastItem())

  • Move or Copy pages between documents

    In the Adobe Help Menu it says... If you copy a page from a document that has a different size than the document you are copying to, it will be resized to the dimensions of the destination.
    I can not get this to work. Can copy from doc to doc, but ad size remains the same. Any help with this please.

    Yup, I think you're right Mr. Mike. I also think that they are trying to make "it" sound like they're making water into wine! Like I said, I'm just plumb frustrated w/trying to learn this program 2day. I'll do better 2morrow... I hope! Thanx all for your help.

  • Why does the frame color change to black when I copy and paste between documents?

    Copying and pasting between documents in Indesign. The color of the text stays the same but the lines and frames change from a specified color to black. Also changes when I drag and drop can anyone tell me how to fix this?

    You have not provided any exact information like what version of ID, system info, paragraph styles, color definitions and whatnot, so we can't know what is going on. either way, ask in the ID forum and provide all those important details.
    Mylenium

  • Copying paragraph styles between documents

    I have a document that contains some text that I want to copy to another document. The original text is tagged with a paragraph style called Body. If the document that I'm copying into already has a paragraph style called Body defined, then when I copy the text into this document, it applies its Body paragraph style to the text I'm copying into it. Is there a way to copy the text and maintain the text styling from the original document (overriding the paragraph style in the receiving document)?
    I am using InDesign CS5.
    Thanks!

    Thank you for your reply, but that doesn't seem to be doing anything for me.
    In document 1, I have a paragraph that is tagged with style Body that is Arial-Narrow, 16 pt. font size and 21 pt. leading. In document 2, there is a style Body in the paragraph styles list; it is Arial-Narrow, 9 pt. font size and 9.5 pt. leading. I selected the entire paragraph in document 1. I click in a text frame in document 2. Whether I choose Edit > Paste or Edit > Paste without Formatting, the resulting paragraph in document 2 is Arial-Narrow, 9 pt. font size and 9.5 pt. leading.

  • Copy Control : Sales document to Sales document

    Dear Experts,
    We have a requirement relating to copy control between sales document to sales document i.e Creating a contract with reference to an already existing data.
    Please consider the following example:
    Contract A
    Valid from: 01-01-2010
    Valid to: 31-12-2010
    Material Code: X1
    Material Pricing Group: Y1
    To enable the users to create a contract with reference to this existing one i set up the copy control between the document types:
    Source document type: ZM05
    Target document type: ZM05
    In VA41 transaction i chose "Create with Reference" and chose the contract tab and entered Contract "A" number.
    In the overview screen the system populates the valid from date as : 01.01.2011 - At item level validity dates is copied same as of contract A.
    Second observation is certain material specific data such as material pricing group does not get copied. Client wants such details also to get copied over into the new contract.
    Could you please provide your valuable inputs on where we can make the settings to copy the data exactly as it was maintained in the existing contract ?
    Thank you
    Regards
    Siddharth Sridhar

    Hi,
    Go to tcode: VTAA and set the the pricing type as 'G' Copy pricing elements unchanged and redetermine taxes and you can try again.
    If you still dont understand, you can send message to me and I will show you some printscreen as I cant show you the print screen here.
    Thanks.

  • The copy question between the same business transaction type

    Hi all,
    I book a opportunity order 1000000002 by copying a same type existence opportunity order 1000000001.The transaction type is OPFS.
    But i can't search the relationship between 1000000001 and 1000000002.
    Where is their DOC flow?
    Which way can help me to find their relationship?
    Thanks for your attention.
    Best wishes.
    Simon Fan.

    Hi
    There is no relationship between documents 1000000001 and 1000000002 as the second document has been made as a copy of the first document and not as a follow up transaction.
    Relationship shall only appear when you make one document as a followup document from another.. eg: like you can make a opportunity as a followup document from lead. If you do this then you can see the relationship in the document flow.
    I hope I have cleared your doubt.
    Regards
    Note: Pls reward points if my explanation helps you.

  • Maintain Copy Control for Document Types.

    Hi Gurus,
    My Client has two customized documents both are order Types and wants to maintain Copy control between them.
    If i see VTAA i can find either New Entries option or copy option.
    When i go for new entries option it asks me Requirements and Routines which needs to be set for this copy control and i am not aware of those.
    The Other option is Copy as but since it's customized document types so i am not getting which document should i take as refernce for copying.
    Please suggest me how to proceed.
    Thanks in Advance!!!!

    Hi
    Ideally we don't gamble with standard settings. Not only in copy control but for all other settings related to document types, conditions, movement types etc etc. If standard settings or configuration has been deleted by human error then we should restore standard settings first. May be BASIS guy can do it and if it is not possible then open some other server where these settings are there and you should do all settings manually by copying the standard ones.
    Why we recommend to always copy standard settings and make necessary changes is that standard settings are done by SAP and they have tested it thoroughly and they have hundreds of consultants who have worked on these settings. Standard settings are reliable and we can copy them without any fear of mistake. Whereas if you copy some Z settings or create new one then there are more chances of some wrong or missing settings. Logically may be it sounds not that important or useful but technically it is really fruitful to do this.
    In standard settings system copies all subsequent settings and you don't need to do those settings again and you are already aware of this fact.
    One more benefit is that you only need to change document names and in create new entry you'll have to enter all the fields one by one and you don't know which value is more appropriate for this field. It also saves time efforts and people like me always prefer to save efforts
    Thank$

  • How to move pages between documents WITHOUT elements shifting

    Hi everyone! My team members and I are so frustrated over what I think should be a really simple issue: copying/moving/dragging pages between documents and NOTHING CHANGING.
    Whenever we move pages between documents (which we have to do on a monthly basis - moving content into client branded files), at least ONE thing will shift and it usually has to do with overset text and/or text wrap. We have googled our brains out. We've tried everything on this list How-To: 10 Techniques for Copying Pages Between InDesign Documents | CreativePro.com and in the various Lynda tutorials we've looked at. We have combined our powers and still can not solve this problem so now I come to you, hoping that you can please please please help us figure out this issue before one of us throws a computer out the window.
    We have this one document. And this is what one of the problem pages looks like. Everything is on one layer. (look at the section marked 5)
    Then I move the pages (copy/paste the content; drag and drop the pages; etc.) into the destination document so we can apply branding.
    AND THIS HAPPENS.
    WHY does this text suddenly become overset?
    The preferences of both documents are IDENTICAL. In fact, Document B was originally created from Document A.
    AND FUN FYI: I took Document A and Saved As a new name. Opened it the new name. And tried moving the pages into the newly named document -- and the SAME EXACT THING HAPPENED.
    I am going to bash my head into a wall. Can someone please shed some light on this? Have you seen this before? How do we fix it??

    aschwartau wrote:
    Doesn't saving as IDML lose some of the properties if you use any shadow or other effects?
    That's not something that I have ever heard, but since I haven't heard everything, I suppose it's possible. What you may be thinking of is that some people use idml to migrate a file to a lower version, and if that lower version lacks a feature of the version that created the file, you will either lose or modify the way that that feature worked in the original. I don't think that even in that scenario that a feature that was present in both versions would go away just because it took a trip through idml to get to an earlier version. And if idml botched shadow or effects, nobody would use it, and I don't think Adobe would have it.
    aschwartau wrote:
    If we had just done a final Save As on the Document A before giving it to the team member who's going to be copying the content into Document B, does that not count as doing a Save As? You mean the minute it's freshly opened try doing another Save As? (P.S. Edit: Just tried this. Didn't change what happened. )
    The thing that Save-As does is remove little bits of data associated with undos that a normal Save retains. Sometimes this data can lead to problems, so any time you do it, it will help, but if you do it at stage 37 and you hand off at stage 38, you will have cleared out most all of anything that may have built up over time. I don't want to give the impression that it is required, but it certainly doesn't hurt, and is probably a good idea to Save-As periodically.

  • Copying Control: Sales Document to Sales Document delete

    hello all,
    I want to prevent users to create a sales order refer to another sales order.
    They always do that in my company, so we have a big document flow and proces are most of the time false :-(.
    I'm a junior in customizing and I htought I can delete the copying control between my sales order type to sames order type.
    What do you think about it? what can be the impact?
    thanks for your help!

    Dear Swiercz,
    There is no harm in Deleting Copy control between Order type to Order type, provided you are sure that either of the Order type would not be used to create other Order type.
    Alternatively, in you copy control settings between Order types, you can delete all the Item Categories that are listed under Item.. This would make sure that no data is copied from one document into other...
    Hope this helps...
    Give points if useful...
    Thanks,
    Jignesh Mehta
    Mumbai, India
    091 98700 10230

  • How to Copy from Billing document F2 to Credit or Debit memo?

    Hello,
    I know the Menu path for copy control of billing document to billing document which  is as follows
    SPROIMG-Sales and Distribution-BillingBilling Documents-Maintain Copy Control of Billing document--Copy COntrol: Billing Document to Billing Document where I give the Source and the target.
    Now I have a scenarion where F2 invoice has ForTrade/Customs information in the Header of F2 invoice which can be viewd through VF03->Header->ForTrade/Customs tab.
    Now that inforamtion has to be transferred to CR/DR which is now not being copied although I have set the copy controls between the billing document.
    So, can anyone help me by providing the information for the following questions?
    1.How will I acheive the copy of Foreign trade to CR/DR from F2?
    2. When I copy from F2 to CR/DR, which all information from F2 will be copied to CR/DR?
    Thanks for the help.
    Anupama Rao

    Anupama,
    The foreign trade data is copied from delivery to billing and any order doesn't contains the foreign trade data and when you create a credit memo request CR by copying F2 invoice the foreign trade data is not copied to CR and when you create a G2 invoice from CR the foreign trade data is not copied because it doesn't exists
    the optimal solution for this is to keep the incompletion for foreign trade in the G2 and L2 inovices
    Regards,
    Santosh

Maybe you are looking for

  • Macbook Pro: OSX and BootCamp Win 7 won't boot

    Hi, I'm having a series of related issues.  I've got a macbook pro 5.2 (17", about 2 years old) with snow leopard installed, bootcamped with win 7. Background: I was logged into Windows playing a game.  System hard locked so I powered down. When I po

  • Database Block Size Smaller Than Operating System Block Size

    Finding that your database block size should be in multiples of your operating system block size is easy... But what if the reverse of the image below were the case? What happens when you store an Oracle Data Block that is 2 KB in an 8 KB Operating S

  • I am having trouble Installing Acrobat XI Pro...

    I am having trouble Installing Acrobat XI Pro... I'm receiving an error that says I need Adobe Application Manager to verify my license.  Each time I try to install Adobe Application Manager 8.0, I receive an error that says the installer failed to i

  • Remove a panel and add a new panel

    hi guys, The scenario is like this i have a frame and a panel on that frame(call mainPanel) so i want to create another panel (firstPanel) to place my information by a click of a button placed at the mainPanel, i want to have another panel (secondPan

  • PRE 12 - Problem editing DSLR footage.

    I have only recently purchased a new Canon Rebel T3i and chose to buy Premiere Elements as my video editor. This is my first venture into video editing and therefore I'm quiet new to everything. Upon imorting my footage into Premiere Elements (which