Skip to main content
Archived

New transformer: HTMLTemplater transformer

Related products:Transformers
  • May 30, 2017
  • 2 replies
  • 42 views

revesz
Supporter
Forum|alt.badge.img+21

A "HTMLTemplater" or HTML option in XMLTemplater would be really handy to create simple HTML content the same convenient way as XMLs (especially using sub templates) instead of AttributeManagers and Aggregators.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • May 30, 2017

Why not simply use the XMLTemplater? HTML is very similar to XML, almost like a subset.

Or is there a use-case where it doesn't work?


revesz
Supporter
Forum|alt.badge.img+21
  • Author
  • Supporter
  • June 2, 2017
There are a few (in HTML5)

 

 

<!doctype html> is still manageable.

 

 

Void elements (<link>, <img>, <meta>, <br>, etc) have start tag only (self closing is optional), which is invalid in XML and XMLTemplater is complaining with "invalid expression: syntax error, end tag </head> does not match start tag <link>" or similar. When you copy/paste an existing code (even from a code generator) and enrich with attributes, it is a pain to make sure every tag is closed.

 

 

Normal elements must have start and (optionally) end tag they, cannot be self closed. (Eg. <div /> is handled as <div>, if the next div element is a start tag, it is rendered as child instead of sibling.) It is much less problem after a bit of HTML coding but when you see someone else's code it is nice to see these potential errors.

 

 

XMLTemplater is all right for XHTML docs but HTML5 is much more common.