× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

show the xml tags

  • jluis.rodriguez.movistar
  • Offline
More
9 years 9 months ago #2923 by jluis.rodriguez.movistar
show the xml tags was created by jluis.rodriguez.movistar
Hello,
i have an xmltype field in mysql, and I'd like to show it with tags. That is,
<tag1>Hello </tag1>
<tag2>Hello 2 </tag2>
and not
Hello
Hello 2

What can I do in order browser do not interpretate the tags?

Thanks in advance

Please Log in to join the conversation.

More
9 years 9 months ago #2925 by Dirk
Replied by Dirk on topic show the xml tags

jluis.rodriguez.movistar wrote: i have an xmltype field in mysql, and I'd like to show it with tags. That is, <tag1>Hello </tag1> <tag2>Hello 2 </tag2> and not Hello Hello 2


There is no such field type like XML for mysql.

If you want the browser to show XML-Tags you have 3 possibilities.
1: Install yourself a code highlighter plugin or enable geshi if you don't have joomla 3.3
/extensions/core-enhancements/coding-a-scripts-integration/code-display
Now you need to change the template and put your field inside a <pre> tag like this:
<pre xml:lang="XML">{joodb field|MYXMLTEXTFIELD}</pre>

2: If you have a pro version write yourself a plugin like this.
/components/com_joodb/plugins/printxml.php
<?php
defined('_JEXEC') or die('Restricted access');
$output .= htmlentities($item->{$part->parameter[0]});
?>
{joodb printxml|MYXMLTEXTFIELD}

3: Output your XML-File inside a textarea tag
<textarea>{joodb field|MYXMLTEXTFIELD}</textarea>

Please Log in to join the conversation.

Moderators: Dirkjoest