question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOMException when using two "ditavalref"'s on first level in map

See original GitHub issue

Reported here:

https://groups.yahoo.com/neo/groups/dita-users/conversations/messages/43072

I’m attaching a sample project:

two-ditavalref-map.zip

There are two ditaval files referenced on the first DITA Map level like:

<map>
  <ditavalref href="ditavals/AWS.ditaval"/>
  <ditavalref href="ditavals/LINUX.ditaval"/>

I can reproduce problem with both DITA OT 2.x and 3.x:

BUILD FAILED
C:\Users\radu_coravu\Desktop\DITA OT newest\dita-ot-3.0.1\build.xml:45: The following error occurred     while executing this line:
C:\Users\radu_coravu\Desktop\DITA OT newest\dita-ot-3.0.1\plugins\org.dita.base\build_preprocess2.xml:110: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
at org.apache.xerces.dom.CoreDocumentImpl.insertBefore(Unknown Source)
at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source)
at org.dita.dost.module.filter.MapBranchFilterModule.splitBranches(MapBranchFilterModule.java:326)
at org.dita.dost.module.filter.MapBranchFilterModule.processMap(MapBranchFilterModule.java:111)
at org.dita.dost.module.filter.MapBranchFilterModule.execute(MapBranchFilterModule.java:78)
at org.dita.dost.ant.ExtensibleAntInvoker.execute(ExtensibleAntInvoker.java:163)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
robandercommented, Nov 19, 2019

Right, it is murky, and I’m not sure it can be fully handled (correctly) without larger changes to the processing pipeline.

Of course, using more than one ditavalref at the start of a map has other issues too. For example if you do it with bookmap (using the proposed DITA 2.0 model), you can end up with two separate sequences of [front matter, chapters, back matter].

I think the best fix here might be:

  • Implement the solution I suggested above
  • If relationship tables + key scopes do not work for some cases (they might, I’m not sure), then try and work out a design with #2147)
  • Advise that if you’re trying to use ditavalref on the root map, you should take care; it may not be the most logical way to publish information anyway, due to the issues that can come up
0reactions
raducoravucommented, May 3, 2022

Problem can still be reproduced with latest DITA OT code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple ditavalref elements as children of map in a root map
Using multiple instances of the ditavalref element as direct children of the map element in a root map is equivalent to setting multiple...
Read more >
google maps two maps on same page [duplicate]
You can have as many maps on a page as you want, aslong as you don't use an ID more than once. You...
Read more >
Understanding Map and Set Objects in JavaScript | DigitalOcean
We can demonstrate this by creating a map and using non-string values as keys, as well as setting two values to the same...
Read more >
Map - JavaScript - MDN Web Docs - Mozilla
The Map object holds key-value pairs and remembers the original ... loop returns a 2-member array of [key, value] for each iteration.
Read more >
Controlling Zoom and Pan | Maps JavaScript API
Users can zoom the map by clicking the zoom controls. They can also zoom and pan by using two-finger movements on the map...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found