| How to embed an XML source example into a HTML page |
|
|
|
You are writing about XML documents and would like to include some examples in your article. The source cannot be inserted as is because it would interfere with the ordinary markup (be it XML or HTML...) so the first idea is to insert it with the characters < and > replaced with their corresponding entity names < and >, but if you modifiy the example you have to redo the procedure ...
There is another solution, although not perfect, which is to use an XSL transform to do the job, with the added benefit that with a specific CSS you can control the presentation. |
||
| How it was solved |
|
|
|
Here an example for XML source:
Source of
page_ex.xml (The preamble is highlighted in red and the XML markup in blue.)
ljr |
||