On 8/25/20 5:59 PM, r...@wmregion.ca wrote:
Hi there,
I’m investigating w2x to see if it will be useful for my organization in
converting Word to HTML. I’m having trouble getting several commands in
an XED script to work. For example, in the XED script I want to test
deleting an HTML element with this command:
delete(/html/head);
However when I run this using w2x on Windows, the output html file still
has the <head></head> element. Am I writing the command improperly?
No, not at all. You simply may not get rid of /html/head.
w2x generates a *valid* XHTML file (even with "-o xhtml_css") and a
valid XHTML document always contains a <head>, itself always containing
a <title>.
I’ve been able to get a couple other commands to work, so it seems the XED
file is being loaded. I’ve also had trouble understanding how to get the
‘insert-after’, ‘wrap-element’ and other commands to identify HTML
elements and work properly.
Example: insert-after,
https://www.xmlmind.com/w2x/_distrib/doc/xedscript/insert-after.html
insert-after(inserted, after?)
Insert inserted, one or more nodes, after node after. Parameter after
defaults to the context node.
--> My explanations:
* Parameter "after" is EITHER a path like /html/head/title. Example:
---
insert-after(<meta name="foo" content="bar"/>, /html/head/title);
---
OR
* Parameter "after" is absent and thus, implicitly, ".", the context node.
".", the context node is typically the current node iterated by a
for-each loop
(https://www.xmlmind.com/w2x/_distrib/doc/xedscript/xed_for-each.html)
Example: duplicate all paragraphs.
for-each /html/body//p {
insert-after(copy(.));
}
Or equivalently:
for-each /html/body//p {
insert-after(copy(.), .);
}
I’ve attached my w2x option .txt file I’m using to load the XED file for
more information.
In order not to loose your time with our product, I'll suggest that you
first read our "Support Policy",
https://www.xmlmind.com/w2x/support_policy.html
In a nutshell, even if your purchase our product, we won't help you
much. We sell a relatively inexpensive conversion tool, not an expensive
conversion service.
--
XMLmind Word To XML Support List
w2x-support@xmlmind.com
https://www.xmlmind.com/mailman/listinfo/w2x-support