Skip to content

Instantly share code, notes, and snippets.

@mcanvar
Created January 21, 2016 16:44
Show Gist options
  • Save mcanvar/e79cf354d251c894ef6c to your computer and use it in GitHub Desktop.
Save mcanvar/e79cf354d251c894ef6c to your computer and use it in GitHub Desktop.
DTD çalışma örneği.
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<!-- INSTEAD OF INNER DTD: <!DOCTYPE catalog SYSTEM "catalog.dtd"> -->
<!-- OR USE BOTH DECLARATIONS: <!DOCTYPE catalog SYSTEM "catalog.dtd"[ ... ]> -->
<!DOCTYPE catalog [
<!ENTITY % p "(#PCDATA)">
<!ENTITY % img_ext SYSTEM "img_ext.ent">
<!ELEMENT catalog (book*)>
<!ATTLIST catalog id IDREFS #IMPLIED>
<!ELEMENT book ( author, title, genre, price, publish_date, image+, img_ext?, description?, publisher?)>
<!ATTLIST book id ID #REQUIRED>
<!ATTLIST book primary_keyword NMTOKEN #IMPLIED>
<!ELEMENT author (#PCDATA)>
<!ATTLIST author id IDREF #IMPLIED>
<!ELEMENT title (#PCDATA)>
<!ELEMENT genre (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ATTLIST price currency (USD | EUR) #IMPLIED>
<!ELEMENT publish_date (#PCDATA)>
<!ELEMENT image EMPTY>
<!ATTLIST image id CDATA #REQUIRED>
<!ATTLIST image src CDATA "/images/default.jpg">
<!ATTLIST image title CDATA #IMPLIED>
%img_ext;
<!ELEMENT description ANY>
<!ATTLIST description about CDATA #FIXED "book">
<!ELEMENT publisher (#PCDATA | name | country)*>
<!ELEMENT name (#PCDATA)>
<!ELEMENT country (#PCDATA)>
<!ENTITY pearson "Pearson Publish">
<!ENTITY longman SYSTEM "long_pub.ent">
]>
<catalog>
<book id="b_101" primary_keyword="xml">
<!-- NOT VALID: <book id="b_101" primary_keyword="what is xml"> -->
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price currency="USD">44.95</price>
<publish_date>2000-10-01</publish_date>
<image id="1" src="" />
<image id="2" src="/images/xml_dev_gui.jpg" title="XML Developer's Guide" />
<image id="3" src="" />
<!-- NOT VALID: <image src="" /> -->
<description about="book">
An in-depth look at creating applications
with XML.
</description>
<publisher>
<name>O' Really</name>
<country>USA</country>
</publisher>
</book>
<book id="b_102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price currency="EUR">5.95</price>
<publish_date>2000-12-16</publish_date>
<image id="1" src="" />
<description about="book">
A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.
</description>
<publisher>&pearson;</publisher>
</book>
<book id="b_103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<image id="1" src="" />
<image id="2" src="" />
<img_ext id="4" />
<description>
After the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society.
</description>
<publisher>
&longman;
</publisher>
</book>
<book id="b_104">
<author>Corets, Eva</author>
<title>Oberon's Legacy</title>
<genre>Fantasy</genre>
<price>5.95</price>
<!-- NOT VALID: <price currency="TRY">5.95</price> -->
<publish_date>2001-03-10</publish_date>
<image id="1" src="" />
<image id="2" src="" />
<image id="3" src="" />
<description>
In post-apocalypse England, the mysterious
agent known only as Oberon helps to create a new life
for the inhabitants of London. Sequel to Maeve
Ascendant.
</description>
</book>
<book id="b_105">
<author>Corets, Eva</author>
<title>The Sundered Grail</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-09-10</publish_date>
<image id="1" src="" />
<description>
The two daughters of Maeve, half-sisters,
battle one another for control of England. Sequel to
Oberon's Legacy.
</description>
</book>
<book id="b_106">
<author>Randall, Cynthia</author>
<title>Lover Birds</title>
<genre>Romance</genre>
<price>4.95</price>
<publish_date>2000-09-02</publish_date>
<image id="1" src="" />
<description>
When Carla meets Paul at an ornithology
conference, tempers fly as feathers get ruffled.
</description>
</book>
<book id="b_107">
<author>Thurman, Paula</author>
<title>Splish Splash</title>
<genre>Romance</genre>
<price>4.95</price>
<publish_date>2000-11-02</publish_date>
<image id="1" src="" />
<image id="2" src="" />
<description>
A deep sea diver finds true love twenty
thousand leagues beneath the sea.
</description>
</book>
<book id="b_108">
<author>Knorr, Stefan</author>
<title>Creepy Crawlies</title>
<genre>Horror</genre>
<price>4.95</price>
<publish_date>2000-12-06</publish_date>
<image id="1" src="" />
<image id="2" src="" />
<image id="3" src="" />
<description>
An anthology of horror stories about roaches,
centipedes, scorpions and other insects.
</description>
<publisher>&pearson;</publisher>
</book>
<book id="b_109">
<author>Kress, Peter</author>
<title>Paradox Lost</title>
<genre>Science Fiction</genre>
<price>6.95</price>
<publish_date>2000-11-02</publish_date>
<image id="1" src="" />
<image id="2" src="" />
<image id="3" src="" />
<description>
After an inadvertant trip through a Heisenberg
Uncertainty Device, James Salway discovers the problems
of being quantum.
</description>
</book>
<book id="b_110">
<author>O'Brien, Tim</author>
<title>Microsoft .NET: The Programming Bible</title>
<genre>Computer</genre>
<price>36.95</price>
<publish_date>2000-12-09</publish_date>
<image id="1" src="" />
<description>
Microsoft's .NET initiative is explored in
detail in this deep programmer's reference.
</description>
</book>
<book id="b_111">
<author>O'Brien, Tim</author>
<title>MSXML3: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>36.95</price>
<publish_date>2000-12-01</publish_date>
<image id="1" src="" />
<image id="2" src="" />
<description>
The Microsoft MSXML3 parser is covered in
detail, with attention to XML DOM interfaces, XSLT processing,
SAX and more.
</description>
</book>
<book id="b_112">
<author>Galos, Mike</author>
<title>Visual Studio 7: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>49.95</price>
<publish_date>2001-04-16</publish_date>
<image id="1" src="" />
<description>
Microsoft Visual Studio 7 is explored in depth,
looking at how Visual Basic, Visual C++, C#, and ASP+ are
integrated into a comprehensive development
environment.
</description>
<publisher>&pearson;</publisher>
</book>
</catalog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment