A Simple XML Document

Here demos a simple XML document, Showing some basic structure within an xml. This will Hopefully act as a  reference and also a good start point.

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<!-- processing instruction, specifically as the xml decleration -->

<!-- declaration -->
<!DOCTYPE telegram 
 SYSTEM "/xmlresources/dtds/telegram.dtd" 
 [
  <!ENTITY entity "<graphic file='ext.jpg' 
>" >
  
<!ENTITY entity-2 "<graphic file='kaka.jpg' >" >
  
<!ENTITY outerent SYSTEM "ref.xml">
  
<!ENTITY outerimg SYSTEM "moon.gif" NDATA GIF>
 ] 
>

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 3.2//EN" 
  "http://www.w3.org/TR/HTML/html.dtd"
>

<!-- processing instruction -->
<?target data?>
<?flubber pg=9 recto?>
<?thingie?>
<?xyz stop: the presses?>
<?xml-stylesheet type="text/css" href="style.css" ?>
<?xml-stylesheet type="text/xml" href="style.xsl" ?>

<!-- above is prolog of this xml document -->


<telegram xmlns:doc="http://www.doc.blah"
 xmlns
="http://www.default.ns">
 
 
<empty-element attribute1="value1" attribute2="" />

 
<container-element>
  Group together elements and character data.
 
</container-element>

 
<!-- Create a section of character data that should not be parsed, 
  preserving any special characters inside it.
 
-->
 
<![CDATA[dvfaregstb##@%$#@%$y^&^&,<>]]>

 
<!-- Command the parser to insert some text stored elsewhere. -->
 
&entity;
 
&entity-2;
 
&outerent;
 
&outerimg;
 
 
&nbsp;&lt;&gt;&amp;&quot;&apos;
 &#1;&#123;
 &#xe7;&#xFFFD;&#x10000;&#x10FFFF;
 
&THORN;
 
 
<doc:ele attr="value" />
 
 
<poem xml:space="preserve">
  i love beijing tianmen square,
  the sun always rise 
  
  
  there.
 
</poem>
</telegram>

 

--END

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值