Copy link to clipboard
Copied
Hello!
There is an issue I am experiencing where when a page is deleted that used to have structure somehow has one piece of the structure thinking there's still a document element attached to it.
Does anyone have advice on how to detect these items? I think maybe they all have "XMLStory" as the page-element parent at the top of it all, just thinking.
I would like to create a method that can be fed an XML element, and it needs to find its XML parents all the way to the top, and return true if the parent of the xmlContent is an instance of XMLStory.
Apparently the ones which do not have a representation in the pages are called "XMLStory", which under it has some kind of all valid elements even if they are not on the document pages.
I found some issue which may be a bug, where indeed I was getting a false positive with the parentTextFrame technique for one item and sure enough, when I visited it in the XML Structure panel, it had a "Go to Item" menu option available.
However, clicking this option just made InDesign unresponsive for a second, before in the XML Structure it underlined the nodes (this is what it does when it 'selects' an item on the page normally related to an XML node), but nothing effectively happens in the document.
So the problem as I would like to call it is "phantom XML".
I wish to ignore all these non-existing-item XML nodes, does anyone have an idea on how to accomplish this?
<Title renamed by MOD>
In my case and anything I foresee in the future for it, I saw how the items that are not associated with an 'on-page' item can have a parent of XmlStory, and although I have not used parentPage as of yet, I was able to eliminate going down the branch that had the 'phantom' items by sensing if the xmlContent's parent was an XmlStory. I noticed that the Root was parented by XmlStory, so I made my collection method to ignore items which such a parent type of their xmlContent when it's one-level dow
...Copy link to clipboard
Copied
Can you share your INDD document?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
This is a preview of your XML as a flat database:
Unfortunately, even after IDMLing - InDesign crashes when trying to access those elements - double click on any cell in my tool.
This is a Text structure of your document:
I've double clicked on the last row on the list - it's your phantom Story.
When I switch to InDesign - blinking cursor is in the center - marked with a red Rectangle.
This is Objects structure of your document:
What is strange - when I double click onn the Story in the XML structure and then load info about Selection - this is what I get - but those objects are fantoms as well:
After deleting manually this phantom Story - this is a new XML structure:
Object Structure is pretty much the same:
And the Text structure - no more phantom Story at the end:
Copy link to clipboard
Copied
But that's what I get when I drag it back:
When you delete objects on the Page - InDesign doesn't remove them from the XML structure - still keeps them "inside".
Copy link to clipboard
Copied
And they are no longer phantoms.
Objects structure:
Text structure:
And fully clickable XML structure:
Copy link to clipboard
Copied
So it just sounds like the non-associated XML should just be removed, yea?
Thank you for the detailed investigation and insights!
Copy link to clipboard
Copied
So it just sounds like the non-associated XML should just be removed, yea?
By @Silly-V
Yes, exactly. What you see on the page - is a graphical representation of the XML's contents.
When you delete associated object on the Page - you are deleting only it's "container" - but it is still present in the XML structure.
It's not the same as deleting TextFrame of a Story with a single TextFrame.
Thank you for the detailed investigation and insights!
By @Silly-V
You are welcome.
Copy link to clipboard
Copied
Hi @Silly-V!
> "Does anyone have advice on how to detect these [phantom XML] items?"
Did you get an answer to this? eg. Is there a function to detect a phantom?
- Mark
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Or simply if it's XMLStory:
XmlStory
XML text content that has not yet been placed in the layout.
Copy link to clipboard
Copied
Great! Thanks Robert.
Copy link to clipboard
Copied
In my case and anything I foresee in the future for it, I saw how the items that are not associated with an 'on-page' item can have a parent of XmlStory, and although I have not used parentPage as of yet, I was able to eliminate going down the branch that had the 'phantom' items by sensing if the xmlContent's parent was an XmlStory. I noticed that the Root was parented by XmlStory, so I made my collection method to ignore items which such a parent type of their xmlContent when it's one-level down.
Maybe this isn't quite correct, but for me just in the cases where I delete a page - it works.