Pl. give me the hint to get the untagged contents using JS?
Thanks in advance.
Did you complete this? If yes pls give me the points...
Thanks in advance...
The untagged content has not null associatedXMLElement because its getting root XMLElement in such case....so how to find untagged content?
I am surprised you get that result. If an item isn't tagged, there is no way you get returned the root xml element.
Given some content of an untagged text frame :
Unless teh content makes part of some tagged textframe, which may return the associatedXMLElements of the parent and even then, no content can be associated with the root as every tagged contents are children of the root. Do you have screenshot ?
The above fig represents, the selected text has placed in the middle of the "sec" tag content. so its associated element is "sec" only.
This fig, selected text has placed in an end of the document. so its associated element is root tag "book".
I see from that image where Loic's confusion comes from.
That paragraph you marked is not really "untagged". If you look in the Tags panel or XML Structure pane, you will see it *is* tagged, with whatever the root object is from the tags above and below this line.
In your first example, the tagged path is "body/sec", according to the Structure pane. But what do you mean this?
... so its associated element is "sec" only.
I mean, it's clear that the paragraph in itself does not have a tag. But attempting to check if an entire paragraph is not tagged seems to be a bit tricky -- I just tried with the following script (and some variations), and got mixed results.
s = app.selection.parentStory;
for (pp=0; pp<s.paragraphs.length; pp++)
p = s.paragraphs[pp];
if (p.associatedXMLElements && p.associatedXMLElements.parent)
if (!confirm (p.contents+"\r=>"+p.associatedXMLElements.parent.markupTag.name)) exit();
You received a response to the above question (one paragraph is missing to tag with in the xml structure)?