vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   CDATA question (https://vborg.vbsupport.ru/showthread.php?t=202671)

vbplusme 01-22-2009 05:13 AM

CDATA question
 
Hello and Greetings,

I have a MOD that I have been trying to learn how it works and found what I think is a strange call in it so I can wondering if anyone can give me a clue why this was done.

Here is the issue:

Code:

<title><![CDATA[mod title test "somequotedtest"]]></title>
The MOD has about a dozen <title> tags in the xml but this is the only one that is wrapped in a CDATA call.

I would really appreciate any info that might explain why this was done.

TIA

Michael

SEOvB 01-22-2009 05:19 AM

CDATA - (Unparsed) Character Data

The term CDATA is used about text data that should not be parsed by the XML parser.

Characters like "<" and "&" are illegal in XML elements.

"<" will generate an error because the parser interprets it as the start of a new element.

"&" will generate an error because the parser interprets it as the start of an character entity.

Some text, like JavaScript code, contains a lot of "<" or "&" characters. To avoid errors script code can be defined as CDATA.

Everything inside a CDATA section is ignored by the parser.

A CDATA section starts with "<![CDATA[" and ends with "]]>":

vbplusme 01-22-2009 05:57 AM

Thanks for the reply. So, would the quotes in the Title tag be the reason that they used the CDATA wrapper? It is the only title tag in the MOD that contains any non Alphanumeric characters.

TIA,

Michael

SEOvB 01-22-2009 07:35 AM

It could be, and more than likely is the reason for the CDATA

vbplusme 01-22-2009 08:10 AM

Thanks again. I decided to test it to see if that was the issue, so I removed the quotes and the CDATA but when I went to import it, I got a fatal error:

XML Error: Attribute without value on line ...

Something else going on there that I have figured out yet.

Given that I am using this as an opportunity to learn how products/plugins are suppose to work together, I think this is a good thing that its making me debug it. :D


thanks again.

Michael

Marco van Herwaarden 01-22-2009 08:26 AM

You should not edit the product xml-files. All edits are done in the AdminCP and will be placed in the xml-file when the product is exported.

vbplusme 01-22-2009 08:32 AM

Thanks for that, I was wondering about that too. In fact I just picked that up from the vBulletin manual and I was thinking that I would get it to work and export it to have a clean version. Thanks very much for the comments.


All times are GMT. The time now is 09:55 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00981 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete