Parsing XML file using Iconara DOM framework
Parsing XML file using Iconara DOM framework
- Subject: Parsing XML file using Iconara DOM framework
- From: "Ramakrishna Kondapalli" <email@hidden>
- Date: Thu, 1 Apr 2004 19:46:51 +0530
- Thread-topic: Parsing XML file using Iconara DOM framework
Hi,
I have an xml file like this
<?xml version = "1.0" encoding = "iso-8859-1"?>
<!DOCTYPE TEAMS_ASSET_FILE PUBLIC "-//TEAMS//DTD asset and link file//EN"
"Tasset.dtd" [
<!ENTITY asset0000001 SYSTEM "./0/test.jpg" NDATA image_jpeg>
<!ENTITY asset0000002 SYSTEM "./0/test.jpg.adf" NDATA unspecified>
]>
<!-- TEAMS Export: name="tsuper_TEAMS" id="0" instance="0"
createDate="null" updateDate="null" description="Export for tsuper_TEAMS"
notes="null" startTime="02/25/2004 14:05:52" userId="tsuper/TEAMS" -->
<TEAMS_ASSET_FILE>
<ASSETS>
<ASSET>
<METADATA>
<UOIS
MASTER_OBJ_NAME_LOC =
"data/repository/original/vol0/0/test_e1eacbfffce6f6d2bf88c7283f5227dc08
c04575.jpg"
SCREEN_RES_OBJ_LOCATION =
"data/repository/screen/vol0/0/test-S_db169d24751558f117f0e863eb29419d45
cbd52d.jpg"
THUMB_NAIL_OBJ_LOCATION =
"data/repository/thumb/vol0/0/test-T_44b52120301c5c4338f1d34a8093ab5ab2f
d00f8.jpg"
>
<LINK_DESTINATION_VIEW
LINK_DESTINATION_TYPE_NAME = "project.asset-included-in"
LINK_DESTINATION_UOI_ID =
"36dff63a4ed1634cbe9336892a27e24eb12cadf8"
/>
</UOIS>
</METADATA>
<CONTENT>
<MASTER FILE="asset0000001">
<OBJECT FILE="asset0000002"/>
</MASTER>
</CONTENT>
</ASSET>
</ASSETS>
<LINKS>
</LINKS>
</TEAMS_ASSET_FILE>
I have to parse this xml using DOM framewrok only
I have created a DOMDocument from above file by using
DOMDocument* doc2 = [DOMBuilder
documentFromFile:@"/Users/rama/Documents/assetProperties.xml"];</FO NT>
DOMElement* element1 = [doc2 rootElement];
DOMDocType* documentType = [doc2 docType];
NSLog(@"DOMElement name = %@ local name = %@, qualifiedName name =
%@",[element1 name], [element1 localName],[element1 qualifiedName]);
NSLog (@"documentType values: name = %@\n publicID = %@\n systemID =
%@\n internalSubset = %@\n XMLString = %@\n",[documentType name],
[documentType publicID], [documentType systemID],[documentType
internalSubset],[documentType XMLString]);
Output :
DOMElement name = TEAMS_ASSET_FILE local name = TEAMS_ASSET_FILE,
qualifiedName name = TEAMS_ASSET_FILE
documentType values: name = TEAMS_ASSET_FILE
publicID = -//TEAMS//DTD asset and link file//EN
systemID = file://localhost/User s/rama/Documents/Tasset.dtd
internalSubset =
XMLString = <!DOCTYPE TEAMS_ASSET_FILE PUBLIC -//TEAMS//DTD asset and
link file//EN file://localhost/User s/rama/Documents/Tasset.dtd>
I am not able to find the ENTITY information i.e
If you see the 3rd line of the file it is always a blank line. I have to
get the information lying between [ ] after "Tasset.dtd" in the xml file.
How can i do this? I think this information is the part of documentType.
But after using all the methods in the DOMDocType we are not able to get
this info. Please suggest how can i get this info.
Thanks
Rama
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.