JIH2000 Posted October 10, 2005 Share Posted October 10, 2005 Hi,I'd appreciate a fresh pair of eyes on this short peice of code, i'm using an editor which says there's something wrong with: <Protocol ID="1"> Saying: A name was started with an invalid character...Any ideas??Thanks in advance. <!DOCTYPE Protocols [ <!ELEMENT Protocols (Protocol)> <!ELEMENT Protocol (Title, Category, Keywords, Uses, Description, Requirements, Method)> <!ATTLIST Protocol ID ID #REQUIRED> <!ELEMENT Title (#PCDATA)> <!ELEMENT Category (#PCDATA)> <!ELEMENT Keywords (#PCDATA)> <!ELEMENT Uses (#PCDATA)> <!ELEMENT Description (#PCDATA)> <!ELEMENT Requirements (#PCDATA)> <!ELEMENT Method (#PCDATA)>]><Protocols> <Protocol ID="1"> <Title> </Title> <Category> </Category> <Keywords> </Keywords> <Uses> </Uses> <Description> </Description> <Requirements> </Requirements> <Method> </Method> </Protocol ID="1"></Protocols> Link to comment Share on other sites More sharing options...
Webworldx Posted October 10, 2005 Share Posted October 10, 2005 Try: <Protocol ID="a1">Not sure whether you can start id's with numbers. Link to comment Share on other sites More sharing options...
JIH2000 Posted October 11, 2005 Author Share Posted October 11, 2005 Try: <Protocol ID="a1">Not sure whether you can start id's with numbers.<{POST_SNAPBACK}> I just tried a1 as you suggested, but that didn't work... I also tried to use IE to view the XML but it gives me the same error, even when i change the line and the DTD to:<!DOCTYPE Protocols [ <!ELEMENT Protocols (Protocol)> <!ELEMENT Protocol (Title, Category, Keywords, Uses, Description, Requirements, Method)> <!ATTLIST Protocol number ID #REQUIRED> <!ELEMENT Title (#PCDATA)> <!ELEMENT Category (#PCDATA)> <!ELEMENT Keywords (#PCDATA)> <!ELEMENT Uses (#PCDATA)> <!ELEMENT Description (#PCDATA)> <!ELEMENT Requirements (#PCDATA)> <!ELEMENT Method (#PCDATA)>]><Protocols> <Protocol number="1"> <Title> </Title> <Category> </Category> <Keywords> </Keywords> <Uses> </Uses> <Description> </Description> <Requirements> </Requirements> <Method> </Method> </Protocol number ="1"></Protocols>A name contained an invalid character. Error processing resource 'file:///D:/Jim/Documents/IT/Protocols.xml'. Line 24, Pos...</Protocol number ="1">------------^Can anyone help? Please... Link to comment Share on other sites More sharing options...
kelnage Posted October 11, 2005 Share Posted October 11, 2005 </Protocol number ="1">------------^Can anyone help? Please... <{POST_SNAPBACK}> I think the problem is because you've included the protocol number in the end tag. Would it be at all possible to remove it? If so, I should think it would fix the problem. Link to comment Share on other sites More sharing options...
JIH2000 Posted October 11, 2005 Author Share Posted October 11, 2005 I think the problem is because you've included the protocol number in the end tag. Would it be at all possible to remove it? If so, I should think it would fix the problem.<{POST_SNAPBACK}> Thanks! that seemed to solve the problem, although i think half the problem was because i was using Xray's XML editor v0.9 (couldn't d/l v2.0) to parse my code. It kept giving the error:<Protocol ID="1"> -----------^A name was started with an invalid character...It wasn't until i tested in IE that it threw the correct error </Protocol ID ="1">------------^I have just switched to XMLpad - brilliant, recommended! It even generates a DTD from your code or a .xml template from your DTD / Schema!! (and it's free )Thanks again to everyone who helped.For anyone else reading this my code now reads:Seperate DTD<?xml version="1.0" encoding="UTF-8"?><!--Generated by WMHelp XMLPad for Protocols. (C) 2004-2005, WMHelp Software.--><!ELEMENT Protocols (Protocol+)><!ELEMENT Protocol (Title, Category, Keywords, Uses, Description, Requirements, Method)><!ATTLIST Protocol ID ID #REQUIRED><!ELEMENT Title (#PCDATA)><!ELEMENT Category (#PCDATA)><!ELEMENT Keywords (#PCDATA)><!ELEMENT Uses (#PCDATA)><!ELEMENT Description (#PCDATA)><!ELEMENT Requirements (#PCDATA)><!ELEMENT Method (#PCDATA)> XML file <!DOCTYPE Protocols SYSTEM "file:///D:/Documents/Work Stuff/Protocols-schema.dtd"><Protocols> <Protocol ID="1"> <Title> </Title> <Category> </Category> <Keywords> </Keywords> <Uses> </Uses> <Description> </Description> <Requirements> </Requirements> <Method> </Method> </Protocol> <Protocol ID="2"> <Title> </Title> <Category> </Category> <Keywords> </Keywords> <Uses> </Uses> <Description> </Description> <Requirements> </Requirements> <Method> </Method> </Protocol> </Protocols> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now