Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 22, 2011 04:55 AM by sam shine
Member
155 Points
90 Posts
Feb 19, 2011 11:56 AM|LINK
Hi all,
I want to write an attribute named "adlcp:scormtype" with value "sco".
My code is like this-
XElement resElement = new XElement("resource"); resElement.SetAttributeValue("adlcp:scormtype", "asset");
Above code gives an foll. ERROR-
"System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a name."
Star
13496 Points
2145 Posts
Feb 20, 2011 04:07 AM|LINK
Hi,
described in this blog post be helpful
Regards
Feb 20, 2011 09:22 AM|LINK
Hi shabir hakim,
thanks for reply, But my prob isnt solved yet.
I want to write hexadecimal character in XML file...
Waiting for reply....!!
14481 Points
2006 Posts
MVP
Feb 20, 2011 12:59 PM|LINK
The sample code snippet
XNamespace adlcp = "http://example.com/adlcp"; XElement resource = new XElement("resource", new XAttribute(XNamespace.Xmlns + "adlcp", adlcp), new XAttribute(adlcp + "scormtype", "asset")); Console.WriteLine(resource);
outputs
<resource xmlns:adlcp="http://example.com/adlcp" adlcp:scormtype="asset" />
Feb 22, 2011 04:55 AM|LINK
Hi Martin Honnen,
thanks for reply...
I want XML structure like -
<manifest identifier="RSSCA" version="2004" xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_v1p3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lom="http://ltsc.ieee.org/xsd/LOM" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 imscp_v1p1.xsd http://www.adlnet.org/xsd/adlcp_v1p3 adlcp_v1p3.xsd http://ltsc.ieee.org/xsd/LOM lom.xsd"> <resources> <resource identifier="r1" type="webcontent" adlcp:scormType="sco" href="indexSCORM.html"></resource> </resources> <manifest>
My code -
XNamespace adlcp = "http://www.imsglobal.org/xsd/imscp_v1p1";
XElement resElement = new XElement("resource", new XAttribute("identifier", "MANIFEST01_RESOURCE" + (identifierPAGEID - 1).ToString()), new XAttribute("href", "resources/" + (identifierPAGEID - 1).ToString() + ".html?questions=" + (identifierPAGEID - 1).ToString()), new XAttribute(adlcp + "scormtype", "asset"), new XAttribute("type", "webcontent"));
<manifest identifier="RSSCA" version="2004" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_v1p3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lom="http://ltsc.ieee.org/xsd/LOM"> <resources> <resource identifier="MANIFEST01_RESOURCE5000" href="resources/5000.html" p6:scormtype="sco" type="webcontent" xmlns:p6="http://www.imsglobal.org/xsd/imscp_v1p1"> </resource> </resources> <manifest> IN above, I dont know how "p6" is writing.
<manifest identifier="RSSCA" version="2004" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_v1p3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lom="http://ltsc.ieee.org/xsd/LOM"> <resources> <resource identifier="MANIFEST01_RESOURCE5000" href="resources/5000.html" p6:scormtype="sco" type="webcontent" xmlns:p6="http://www.imsglobal.org/xsd/imscp_v1p1"> </resource> </resources> <manifest>
Pls help...
sam shine
Member
155 Points
90 Posts
System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a name.
Feb 19, 2011 11:56 AM|LINK
Hi all,
I want to write an attribute named "adlcp:scormtype" with value "sco".
My code is like this-
XElement resElement = new XElement("resource"); resElement.SetAttributeValue("adlcp:scormtype", "asset");Above code gives an foll. ERROR-
"System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a name."
shabirhakim1
Star
13496 Points
2145 Posts
Re: System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a n...
Feb 20, 2011 04:07 AM|LINK
Hi,
described in this blog post be helpful
c# - The ':' character, hexadecimal value 0x3A, cannot be included ...
</div>Get more discussion results
c# - XML Exception: Invalid Character(s) - Stack Overflow
</div>Regards
sam shine
Member
155 Points
90 Posts
Re: System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a n...
Feb 20, 2011 09:22 AM|LINK
Hi shabir hakim,
thanks for reply, But my prob isnt solved yet.
I want to write hexadecimal character in XML file...
Waiting for reply....!!
Martin_Honne...
Star
14481 Points
2006 Posts
MVP
Re: System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a n...
Feb 20, 2011 12:59 PM|LINK
The sample code snippet
XNamespace adlcp = "http://example.com/adlcp"; XElement resource = new XElement("resource", new XAttribute(XNamespace.Xmlns + "adlcp", adlcp), new XAttribute(adlcp + "scormtype", "asset")); Console.WriteLine(resource);outputs
Adjust the namespace URI "http://example.com/adlcp" to the one you need but as you haven't provided that information I hade to make a URI up. See also http://msdn.microsoft.com/en-us/library/bb387093.aspxMy blog
sam shine
Member
155 Points
90 Posts
Re: System.Xml.XmlException: The ':' character, hexadecimal value 0x3A, cannot be included in a n...
Feb 22, 2011 04:55 AM|LINK
Hi Martin Honnen,
thanks for reply...
I want XML structure like -
<manifest identifier="RSSCA" version="2004" xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_v1p3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lom="http://ltsc.ieee.org/xsd/LOM" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 imscp_v1p1.xsd http://www.adlnet.org/xsd/adlcp_v1p3 adlcp_v1p3.xsd http://ltsc.ieee.org/xsd/LOM lom.xsd"> <resources> <resource identifier="r1" type="webcontent" adlcp:scormType="sco" href="indexSCORM.html"></resource> </resources> <manifest>My code -
XNamespace adlcp = "http://www.imsglobal.org/xsd/imscp_v1p1";
XElement resElement = new XElement("resource", new XAttribute("identifier", "MANIFEST01_RESOURCE" + (identifierPAGEID - 1).ToString()), new XAttribute("href", "resources/" + (identifierPAGEID - 1).ToString() + ".html?questions=" + (identifierPAGEID - 1).ToString()), new XAttribute(adlcp + "scormtype", "asset"), new XAttribute("type", "webcontent"));AND My output is like this -