I'd appreciate help in getting meaningful blank-spaces into a 'Web.sitemap'. I've cut-down the horizontaql menu greatly in the code that follows but the example is that "Catalog" is a one letter shorter word than "Calendar" and I'd like "2012-2013" to line-up
directly over "2011-2012".
I do have two spaces between "Catalog" and "2012-2013" in my source code. The act of posting code here removed the second space just as it is removed by rendering the XML. The last line of the internal DTD,
<!ATTLIST title xml:space (default|preserve) 'preserve'> is the only way that I have searched-out as to adding meaningful spaces into XML but I have not seen anywhere how to implement it. Again, I already have the requisite number of spaces
in my source code but the second space is being removed when the code is rendered.
Yes, as stated previously, there has always been "another new white space between 'Catelog' and '2012-2013'". It gets stripped-out when the code is rendered - even when I post here. To illustrate, I have replaced white spaces with the lower-case letter
"b" in the following code:
That errors-out with "Entity 'nbsp' not defined". So that was not the "The Answer" and you should not have marked it as such.
There are only 5 predefined entity references in XML:
< < less than
> > greater than
& & ampersand
' ' apostrophe
" " quotation mark
is not one of them and HTML truncates multiple white space characters to one single white-space:
HTML: Hello Tove
Output: Hello Tove
where even with XML, the white-space in a document is not truncated, it was being truncated when the XML of the Web.sitemap was rendered by the HTML web server.
What did work (still a little bit off but a lot closer) was the HTML Special Character   the "Non-breaking space" which was rendered (close enough) by the HTML web server where was not. So even though a HTML chart may list them as the same, the results are what count.
tagtech
Member
45 Points
48 Posts
xml:space in Internal DTD for Web.sitemap
Apr 16, 2012 08:30 PM|LINK
I'd appreciate help in getting meaningful blank-spaces into a 'Web.sitemap'. I've cut-down the horizontaql menu greatly in the code that follows but the example is that "Catalog" is a one letter shorter word than "Calendar" and I'd like "2012-2013" to line-up directly over "2011-2012".
-Thanks
<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE siteMap [ <!ELEMENT siteMap (siteMapNode*)> <!ELEMENT siteMapNode (siteMapNode*)> <!ELEMENT siteMapNode (url*, title*, description*)> <!ATTLIST title xml:space (default|preserve) 'preserve'> ]> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="" title="" description="Home Page" > <siteMapNode url="" title="Training" description="" > <siteMapNode url="~/3Train/catalog/default.aspx" title="Catalog 2012-2013" description="" /> <siteMapNode url="~/3Train/calendar/narratives/public.aspx" title="Calendar 2011-2012" description="" /> </siteMapNode> </siteMapNode> </siteMap>TimoYang
Contributor
3732 Points
1275 Posts
Re: xml:space in Internal DTD for Web.sitemap
Apr 18, 2012 02:07 AM|LINK
Hi man:-)
You should delete the defination of DTD, or I'm afraid you cannot do that——
Remove:
<!DOCTYPE siteMap [ <!ELEMENT siteMap (siteMapNode*)> <!ELEMENT siteMapNode (siteMapNode*)> <!ELEMENT siteMapNode (url*, title*, description*)> <!ATTLIST title xml:space (default|preserve) 'preserve'> ]>And then extend the "Catelog" by adding a space:
tagtech
Member
45 Points
48 Posts
Re: xml:space in Internal DTD for Web.sitemap
Apr 18, 2012 01:40 PM|LINK
I do have two spaces between "Catalog" and "2012-2013" in my source code. The act of posting code here removed the second space just as it is removed by rendering the XML. The last line of the internal DTD, <!ATTLIST title xml:space (default|preserve) 'preserve'> is the only way that I have searched-out as to adding meaningful spaces into XML but I have not seen anywhere how to implement it. Again, I already have the requisite number of spaces in my source code but the second space is being removed when the code is rendered.
TimoYang
Contributor
3732 Points
1275 Posts
Re: xml:space in Internal DTD for Web.sitemap
Apr 19, 2012 07:55 AM|LINK
Have you added another new white space between "Catelog" and "2012-2013"?
tagtech
Member
45 Points
48 Posts
Re: xml:space in Internal DTD for Web.sitemap
Apr 19, 2012 03:28 PM|LINK
Yes, as stated previously, there has always been "another new white space between 'Catelog' and '2012-2013'". It gets stripped-out when the code is rendered - even when I post here. To illustrate, I have replaced white spaces with the lower-case letter "b" in the following code:
<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE siteMap [ <!ELEMENT siteMap (siteMapNode*)> <!ELEMENT siteMapNode (siteMapNode*)> <!ELEMENT siteMapNode (url*, title*, description*)> <!ATTLIST title xml:space (default|preserve) 'preserve'> ]> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="" title="" description="Home Page" > <siteMapNode url="" title="Training" description="" > <siteMapNode url="~/3Train/catalog/default.aspx" title="Catalogbb2012-2013" description="" /> <siteMapNode url="~/3Train/calendar/narratives/public.aspx" title="Calendarb2011-2012" description="" /> </siteMapNode> </siteMapNode> </siteMap>TimoYang
Contributor
3732 Points
1275 Posts
Re: xml:space in Internal DTD for Web.sitemap
Apr 20, 2012 01:05 AM|LINK
That's strange……You can try " "——
tagtech
Member
45 Points
48 Posts
Re: xml:space in Internal DTD for Web.sitemap
Apr 24, 2012 08:22 PM|LINK
That errors-out with "Entity 'nbsp' not defined". So that was not the "The Answer" and you should not have marked it as such.
There are only 5 predefined entity references in XML:
is not one of them and HTML truncates multiple white space characters to one single white-space:
where even with XML, the white-space in a document is not truncated, it was being truncated when the XML of the Web.sitemap was rendered by the HTML web server.
http://www.w3schools.com/xml/xml_syntax.asp
What did work (still a little bit off but a lot closer) was the HTML Special Character   the "Non-breaking space" which was rendered (close enough) by the HTML web server where was not. So even though a HTML chart may list them as the same, the results are what count.
<siteMapNode url="" title="Training" description="" > <siteMapNode url="~/3Train/calendar/narratives/public.aspx" title="Calendar 2011-2012" description="" /> <siteMapNode url="~/3Train/catalog/default.aspx" title="Catalog  2012-2013" description="" /> </siteMapNode>The above code worked (close enough). Thanks for responding, Timo, and thanks to the forum for all you put out there for consideration and help.