<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Seagull Code Nodes &#187; semantic</title>
	<atom:link href="http://blog.joshuasiegal.com/tag/semantic/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.joshuasiegal.com</link>
	<description></description>
	<lastBuildDate>Tue, 05 Oct 2010 06:25:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Rel Isn&#8217;t That Nice</title>
		<link>https://blog.joshuasiegal.com/2010/rel-isnt-that-nice/</link>
		<comments>https://blog.joshuasiegal.com/2010/rel-isnt-that-nice/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 17:44:25 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[semantic]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=202</guid>
		<description><![CDATA[Just a quick post to talk about how much I&#8217;m loving the rel tag these days.   Defining custom values for this attribute may not be strictly validated, but there seems to be some debate about this, and with HTML 5, we&#8217;re going to be moving that way with the all-encompassing data- tag. But for now, [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick post to talk about how much I&#8217;m loving the rel tag these days.   Defining custom values for this attribute may not be strictly validated, but there seems to be some debate about this, and with HTML 5, we&#8217;re going to be moving that way with the all-encompassing <a title="The HTML5 data tag" href="http://www.danwebb.net/2010/1/27/put-that-data-attribute-away-son-you-might-hurt-someone" target="_blank">data-</a> tag.</p>
<p>But for now, the rel tag is easy, supported, and makes getting a little bit of meta information to your script quite easy.</p>
<p>Two uses I&#8217;ve written recently are:</p>
<p>(1) Creating abstracted div collapse scripts.  The script just looks at the rel tag for the link and finds the matching rel tag among a class of divs on the page.  Anything matching is shown, anything not matching is hidden.  I never have to go back and touch the script, and I only have to add a rel tag to my divs.</p>
<p>(2) Letting my css-based navigation know which page we&#8217;re currently on.  With includes, the idea that your navigation should reflect your current page location fell out of favor a bit.  Kind of suspicious, if you ask me.  It often seems designers and front-end developers adapt their pet styles to suit the latest technology.  Regardless, it&#8217;s dang easy with the rel tag to revert to the &#8220;old&#8221; style of location-aware navigation.  I just drop a rel tag in my nav links and a matching rel tag in my content div within the content include file.  They search for each other.  They find one another.  It&#8217;s like an interface component romance paperback.</p>
<p>Part of the reason that HTML 5 is going to include some developer-defined tags is that people have been using rel and a few other tags to include meta data (and sometimes some not-so-meta data) in their front-end code.  I completely understand the cold chill that comes over some folks when they start contemplating gobs of data gooping up the front end.  I also think it&#8217;s possible to fret too much.  As the linked article above points out well, it&#8217;s possible to include some meta data inline and still be semantically useful, degrade nicely, and not offend the browser.</p>
<p>If people hadn&#8217;t been expanding on the uses of the rel attribute so effectively, we may not have had the push for user-defined attributes in HTML 5.  This is a good thing.  It&#8217;s important to remember this truism: no amount of standards will stop people from writing ugly code.  But, paying attention to what developers are doing in practice and honoring those practices in new standards definitions can benefit everyone.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2010/rel-isnt-that-nice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sufferin Semantics! XML, HTML, jQuery, and MSIE</title>
		<link>https://blog.joshuasiegal.com/2010/sufferin-semantics-xml-html-jquery-msie/</link>
		<comments>https://blog.joshuasiegal.com/2010/sufferin-semantics-xml-html-jquery-msie/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 22:54:32 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[semantic]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=168</guid>
		<description><![CDATA[So, in a recent project, I&#8217;m consuming xml data and pulling out some text for a description field on an html page.  I&#8217;ve got some basic stuff, text for title information, paths to asset files stored as node attributes, the usual.  But something is bugging me.  I&#8217;ve included some html in my descriptions, all formatted [...]]]></description>
			<content:encoded><![CDATA[<p>So, in a recent project, I&#8217;m consuming xml data and pulling out some text for a description field on an html page.  I&#8217;ve got some basic stuff, text for title information, paths to asset files stored as node attributes, the usual.  But something is bugging me.  I&#8217;ve included some html in my descriptions, all formatted according to xhtml standards, but it won&#8217;t be parsed by jQuery.</p>
<p>Dagnabit!  What is the point of combining xml and html standards if I can&#8217;t use them together all the time?  I know, you may be thinking, but xml is not html , no matter what you throw into your nodes.  You&#8217;re right, and this is exactly what jQuery tells us.  You can grab the text contents of any node, but if you have html tags in there, the <a title="jQuery API - text method" href="http://api.jquery.com/text/" target="_blank">.text()</a> method in jQuery will just look right past them.  As it should.  This works fine, for little snippets like my titles, but what if I want to put some (ostensibly) well-formatted html code in my data?  Further, what about all those applications where you want to store html snips in a database and read them out in XML?  How do you get around this?</p>
<p><span id="more-168"></span></p>
<p>For that, we&#8217;d want to use the <a title="jQuery API - html method" href="http://api.jquery.com/html/" target="_blank">.html()</a> method of jQuery, and for that, my friends, we suddenly get quite strict.  XML, according to jQuery, is not html, and so has no innerHTML quality for the .html() method to grab.  It doesn&#8217;t matter, says jQuery, if your html code is so well formatted that it can be parsed as xml&#8230;it&#8217;s just not possible to access an html-specific property that does not exist.</p>
<p>Like fun, I say!</p>
<p>But before we get to the solution, let&#8217;s heartlessly go over some available options:</p>
<p>1) We could punt on the whole jQuery thing and use Flash, which knows just what to do with a string of html parsed from within an xml node.  Furthermore, Flash has a nifty .htmlText property on its text fields, and although the formatting of said html pales compared to real css, it will faithfully render as html anything you tell it to, caveat codeur.  Since the project in question did involve some Flash, this was an option, but one of the points of the project was to take the same xml data and have both flash and jQuery parse it for different purposes, and thereby provide ease for content providers and improve accessibility.  So doing the whole thing in Flash was out.</p>
<p>2) We could escape the heck out of all our characters and turn the whole node into a mess of html character codes.  Un-fun to code and messy for the content people.  Also, I tried that and it rendered out a block of actual html onto my screen.  I&#8217;m sure I could have reconverted those characters back into actual html behind the scenes, but again, un-fun and a hassle.</p>
<p>3) Use a fancy xml consuming plugin or script.  There are some neat ones out there, and I tried one in particular that looked pretty good, but it seems they have a common issue &#8211; you have to know what tags you&#8217;re looking for in order to seek and replace within the script.  Some of them will hunt for anything that looks like an html tag in the string and convert that, but mostly these plugins seem like scripts that people wrote to perform functions for themselves, and then extracted and shared.  Which I applaud.  But these were not what I was looking for, and I found the implementation sometimes troublesome.</p>
<p>4)<strong> [Warning: bad solution]</strong> Hand jQuery a bag of grapes and say it&#8217;s &#8220;nature&#8217;s jellybeans&#8221; (at least that&#8217;s what my mom used to do to us).  It goes like so: grab your xml file with an <a title="jQuery API - ajax method" href="http://api.jquery.com/jQuery.ajax/" target="_blank">ajax()</a> call, and use the optional key/value pair:</p>
<blockquote><p>dataType: &#8220;html&#8221;</p></blockquote>
<p>And then you&#8217;d do ike so:</p>
<blockquote><p>$.ajax({ url: &#8220;myXMLdoc.xml&#8221;,<br />
dataType: &#8220;html&#8221;,<br />
success: function(xml){<br />
var myHtmlContent = $(&#8216;node&#8217;,xml).eq(id).find(&#8220;nodeName&#8221;).html();<br />
$(&#8220;#targetdiv&#8221;).html(myHtmlContent);<br />
}<br />
});</p></blockquote>
<p>&#8230;and there you have it!  Or, would&#8230;if&#8230;</p>
<p>&#8230;can you see where this is going?</p>
<p>&#8230;search your feelings, Luke&#8230;</p>
<p>&#8230;if only Internet Explorer handled the XMLHTTPRequest result like the rest of the world!  Like most Microsoft stuff, IE, with its <strong>own</strong> version of the XMLHTTPRequest (someone <a title="Microsoft XMLHTTPRequest documentation" href="http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx" target="_blank">correct me if I&#8217;m wrong on that</a>), wants to get too clever and won&#8217;t let you, the developer, tell it what kind of data you&#8217;d like to see (even if it&#8217;s either of several types that are verging toward common standard).  No siree!</p>
<p>Supposedly, recent versions of IE (7+) have their own XMLHTTPRequest, not the previous Microsoft HTTPRequest.  However, the Microsoft XMLHTTPRequest doesn&#8217;t behave like the other girls and boys, even in the recent versions of IE.  Now, this post didn&#8217;t start off to be a discussion of the supposed evils of Microsoft&#8217;s proprietary habits.  But who else has almost 11 million results on a <a title="google search: internet explorer sucks" href="http://www.google.com/#hl=en&amp;q=internet+explorer+sucks&amp;aq=f&amp;aqi=&amp;oq=&amp;fp=c26c79a56c95bda8" target="_blank">google search of how much they suck</a>?  Hint: not Chrome (3 M), Firefox (1 M), or Safari (1 M).  (Can&#8217;t evaluate Opera on this critrion because sadly a lot of people out there think that real, actual opera &#8211; the music &#8211; sucks too).  For comparison: &#8220;yanni sucks&#8221; (400 K), &#8220;death metal sucks&#8221; (700 K), &#8220;paris hilton sucks&#8221; (1 M), &#8220;the lions suck&#8221; (1 M), &#8220;tv sucks&#8221; (11 M), and &#8220;new york sucks&#8221; (12 M).  So, yeah.</p>
<p>Anyway, after that turgid digression, <em>finally,</em> we come to the solution.  And&#8230;</p>
<p>It&#8217;s simple!  Maybe I&#8217;m, like, the last one to figure this out, but you just use XML&#8217;s <a title="W3C XML CDATA" href="http://www.w3schools.com/XML/xml_cdata.asp" target="_blank">CDATA</a> declaration, and wrap it around our html code within our xml node.  If I had found that idea earlier, it would have saved me some time, but I would have missed a brain-scratching moment or ten for sure.</p>
<p>Anyway, this is fascinating to me for several reasons:</p>
<p>a) When oh when is Microsoft going to just give up and give us a truly standards-compliant web browser?  Maybe they should spin off a company whose software is intuitive and flexible and plays nice with others.  Oh wait, <a title="apple" href="http://www.apple.com/" target="_blank">they already did that</a>.</p>
<p>b) With the XHTML standard in full force, it seems totally silly that one would have to pass off perfectly valid XHTML within an xml document as CDATA.  Isn&#8217;t the whole point of XHTML to be able to one day have a semantic web, where code itself can be meaningful?  How far away are we when it&#8217;s trouble to get even well-formatted html out of my xml nodes without basically commenting it out?  In theory, that means I can&#8217;t parse through my html elements, which seems to go against the whole ethos of XHMTL.</p>
<p>Well, heck.  I remember when CSS was going to put an end to bad code.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2010/sufferin-semantics-xml-html-jquery-msie/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Call for CSS Math</title>
		<link>https://blog.joshuasiegal.com/2009/a-call-for-css-math/</link>
		<comments>https://blog.joshuasiegal.com/2009/a-call-for-css-math/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 17:59:58 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[semantic]]></category>

		<guid isPermaLink="false">http://blog.joshuasiegal.com/?p=81</guid>
		<description><![CDATA[Not talking about MathML here, but the addition of simple addition, subtraction, multiplication and division in CSS values. By this time, I&#8217;ve worked my head around the idea that, to many developers (and clients) out there, CSS is the one true way and tables are only good for displaying data &#8211; that is, data that [...]]]></description>
			<content:encoded><![CDATA[<p>Not talking about <a title="MathML" href="http://www.w3.org/Math/" target="_blank">MathML</a> here, but the addition of simple addition, subtraction, multiplication and division in CSS values.</p>
<p>By this time, I&#8217;ve worked my head around the idea that, to many developers (and clients) out there, CSS is the one true way and tables are only good for displaying data &#8211; that is, data that they consider data and not data that someone else might consider data.  See my <a title="Semantic HTML Literacy" href="http://blog.joshuasiegal.com/2009/semantic-html-literacy/">previous post on semantic html</a> for more carping on this topic.  But enough negativity &#8211; I would hereby like to add my voice to the growing number of developers calling for a new future in CSS: [paraphrase] &#8220;If CSS is the golden chalice of front-end web development, how come it can interpret between pixels, point sizes, and em sizes, but it can&#8217;t add 1 + 1?&#8221;</p>
<p>Now, I know, purists will say that Javascript is for math, and CSS is for styling.  Just simply get a good Javascript library and do your math there.  The problem is that other purists will say that using Javascript to generate your CSS positions is pure hackery.  And yet other purists will say &#8220;everyone come to my website to check out my awesome CSS hacks!&#8221;</p>
<p><span id="more-81"></span></p>
<p>Let&#8217;s face up to it: there are some things that CSS is just not that good at.  The idea that you are ruining your SEO by adding three lines of table code to get your column heights equalized seems dubious.  But, I&#8217;m willing to go with that and check out some truly <a title="Matthew James Taylor's Holy Grail 3-Column Layout" href="http://matthewjamestaylor.com/blog/perfect-3-column.htm" target="_blank">weird and wonderful</a> tricks to arrive at the same solution that would take literally half a dozen lines of code using old clunky tables.  But yeah, I&#8217;m sure google&#8217;s robots are completely fooled by a table and a couple of &lt;tr&gt; tags&#8230; [sarcsasm alert].</p>
<p>Anyway, if CSS is going to be responsible for our layout and can have access to and control some of the DOM, why can&#8217;t we just do:</p>
<blockquote><p>#layerid {<br />
width:20%;<br />
margin:10px auto;<br />
height:width * 0.5;<br />
}</p></blockquote>
<p>That would really open things up and allow for some more creative, interactive layouts.  Hopefully, CSS 4 will allow for some of this.  It should be, in my opinion, a no-brainer.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2009/a-call-for-css-math/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Semantic HTML Literacy</title>
		<link>https://blog.joshuasiegal.com/2009/semantic-html-literacy/</link>
		<comments>https://blog.joshuasiegal.com/2009/semantic-html-literacy/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 17:56:22 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[divs]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[semantic]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://joshuasiegal.com/blog/?p=1</guid>
		<description><![CDATA[Since shortly after people started using markup to organize data, the dream has been knocked around that one day the structure and the content would become seamlessly intertwined.  However, this is a tiny bit counterintuitive, as I see it, as one of the features of XML, for example, is to delineate data and content apart [...]]]></description>
			<content:encoded><![CDATA[<p>Since shortly after <a title="History of XML - Wikipedia" href="http://en.wikipedia.org/wiki/XML#History" target="_blank">people started using markup to organize data</a>, the dream has been knocked around that one day the structure and the content would become seamlessly intertwined.  However, this is a tiny bit counterintuitive, as I see it, as one of the features of XML, for example, is to delineate data and content apart from the meta-data that applies to it.</p>
<p>The real dream has been that one day, HTML and XML would be combined (not just in terms of the XHTML standard), and that the web would turn into a big soup of meta information.  This would allow all sorts of wonderfully customizable content, searching, cross-threading, and possibly, someday, even help create some kind of internet based solely on context, rather than infrastructure and IP.  Positives: super-personalized web-browsing, advertisements, and content aggregation.  Negatives: super-personalized web-browsing, advertisements, and content aggregation.</p>
<p>But I digress.  The flock to div tags as cleaner and more semantically meaningful has been a beneficial one, but for we web developers who remember the [good?] [bad?] old days, there are more than a few cases in memory of the development community rushing en masse to the next greatest thing, and then flipping it into reverse with the release of the next IE browser / web standard / greatest thing.</p>
<p><span id="more-1"></span></p>
<p>It has gotten to the point where I have seen postings looking for people who write div- and css-based code &#8211; <em>no tables allowed!</em></p>
<p>This is madness.  What is XML, after all, than a method of organizing data?  When you&#8217;re getting an XML feed from a backend, you are converting your data from a table-based format (database) to a markup-based format.  Same data (we hope).  The real question here is page layout.  Surely web developers who are using and editing one another&#8217;s code would rather see:</p>
<blockquote><p>&lt;div id=&#8221;header&#8221;&gt;&lt;!&#8211; header &#8211;&gt;&lt;/div&gt;</p></blockquote>
<p>than</p>
<blockquote><p>&lt;table border=&#8221;0&#8243; class=&#8221;table&#8221; cellpadding=&#8221;0&#8243; cellspacing=&#8221;0&#8243;&gt;<br />
&lt;tr&gt;<br />
&lt;th&gt;&lt;!&#8211; header &#8211;&gt;&lt;/th&gt;<br />
&lt;tr&gt;<br />
etc.</p></blockquote>
<p>But while that div is nice and neat and it allows for better accessibility, it does not do as well when it comes time for, let&#8217;s say:</p>
<p><a title="One good use for tables" href="http://espn.go.com/nfl/statistics/team/_/stat/downs/sort/thirdDownConvPct" target="_blank">this</a>.</p>
<p>Also, despite the wonderful blessing that is CSS (<a title="CSS Zen Garden" href="http://csszengarden.com/" target="_blank">it can be quite soothing</a>), when something goes wrong with the style sheet, the result can be disastrous.  Of course, we all want to write code that degrades gracefully, but the fact is that, the more we ask of our code &#8211; especially as we utilize style sheets &#8211; the more risk we run that if something breaks on the backend (certainly our code would never break), or a user is tied to a hopelessly outdated browser, the result will be unintelligible.</p>
<p>But back to semantics, for their own sake.  Perhaps it comes down to a particular aesthetic, but the notion of a fully semantic web makes me think of those kitschy items that have the word for the item printed on them, for example a mug that says &#8220;MUG&#8221;.  Maybe there is a bit too much big-picture here, for a change.  Net neutrality&#8217;s goal is access and publishing rights for anyone with an internet connection.   It&#8217;s not hard to imagine a semantic web that wants to take choices out of our hands and push certain content in front of our eyeballs for us.</p>
<p>As for us developers, if the goal is good, solid code, the answer seems to be, like with much else, a healthy mix of new and old, with an eye towards every tool and its best use.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.joshuasiegal.com/2009/semantic-html-literacy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
