Skip to main content
Archived

New transformer: HTMLTemplater transformer

Related products:Transformers
danilo_fme
  • danilo_fme
    danilo_fme

revesz
Contributor

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 a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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
Contributor
Forum|alt.badge.img+15
  • Author
  • Contributor
  • 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.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings