NeoPhoto: Software for sharing photos with Family and Friends.
NeoPhoto

2.3. HTML inside an XML file

The NeoPhoto Template language has it's own unique set of tags that are used to tell NeoPhoto what HTML it should output for each section of a web photo gallery. For instance, there is a <Header> tag, the text data of which contains the HTML that gets output at the top of the page to form the header. There's another tag called <Footer> that contains the HTML for the bottom of the page.

Because you cannot include “<” and “>” characters in text data sections, there is a complication that arises when you're trying to embed HTML text in the text data sections of an XML file.

In this example, when NeoPhoto goes to generate the top section of the HTML page, it'll output the text between <Header> and </Header>. Ideally, we'd like to output some HTML tags intead of just text. Consider a typical HTML page:

Now if we try to combine the two we run into a serious problem:

The text data between <Header> and </Header> may not have any “<” or “>” characters. As a result, the above will not work the way you expect.

To solve this problem, XML languages include the notion of “Encoding”. If you want to include “<” , “>” and some other characters in the text data section between tags or as the value of an attribute you have to “encode” them. There is a list of encoding for different problematic characters. For instance “<” turns into &lt;. “>” turns into &gt;. “&” turns into “&amp;”. etc.

Properly “encoded” the example above would become:

By properly enoding the HTML, we can include HTML into the text sections between tags. Unfortunately entering all these encoded brackets and matching them up by hand is terribly errorprone. We don't recommend that you edit NeoTemplate files using a normal text editor. You should use a special purpose XML editor that does all the encoding for you.