englishteeth.co.uk

… the weblog of Ian “English Teeth” Robinson
  • rss
  • Home

This week I have mostly been reading…

Ian | May 4, 2008

I was needing to brush up a style sheet and wanted a clean way to apply drop shadows, which I found here.

I often use the in-line lists for page navigation, but I hadn’t come across the use of floats described in this post here and here. However, while looking for a slick way of producing “rounded corners”, I found an implementation using sliding doors that happened to have the drop shadow I was after as part of the border image here, though I must admit to preferring the variation I found here.

And when I needed to print CSS background images, this post proved most helpful.

Along the way, I stumbled across the site Position Is Everything which looked like it might be worth making a note of.

Following the news of the Spring Source Application Platform I need to look back at this post on web applications and OSGi.

I also enjoyed this post on converting Java to Groovy.

Following a little foray down the path of UML modelling XML Schemas for a colleague, this article articulated what I was trying to get across much better than I could have. Rational Software Architect unfortunately couldn’t quite grasp it quite as easily. No change there then…

Comments
No Comments »
Categories
development
Tags
css, groovy, java, links, osgi, spring, uml, xml
Comments rss Comments rss
Trackback Trackback

Freeware XSD Editor

Ian | April 30, 2008

I wanted to generate some sample XML from an XSD I was given and I was struck by the lack of resources outside of the over bloated Altova tools and their misguided clones much more heavy weight options that seem overkill for what I’m trying to do.

I was actually hoping to find a style sheet that could do the job, but I had no luck.

Along the way though, I did find Liquid XML Studio which in it’s freeware incarnation has some nice schema viewing, editing and generation features. There’s also an integrated web service browser



and although, I haven’t played with it much yet, there’s an XPath expression builder in there too.



My only disappointment is the lack of XSLT support, at least in the freeware version. I’m looking for a reasonable successor to MarrowSoft Xselerator which is no longer supported or being sold by TopXML. Xselerator is not compatible with Microsoft Internet Explorer 7, which I has not actually proved a problem for me yet, but it’s days must be numbered.

I’m not adverse to paying for software (Xselerator wasn’t free), but I must admit to being put off a little by hobbled versions. An issue covered much better than I could by Jeff Atwood, here.

My favourite Cyberlink love/hate thing comes to mind; Power DVD Ultra, Power DVD Deluxe, Power DVD Standard or Power DVD OEM. Mmm, now let me see… do any of them work reliably?

Comments
3 Comments »
Categories
development, software
Tags
freeware, webservice, xml, xpath, xsd, xslt
Comments rss Comments rss
Trackback Trackback

Groovy

Ian | March 31, 2008

So I can now say that I’ve had my first real project exposure to groovy!

Groovy

In this instance it was occupying the space where AWK or SED scripts might have been found in the past. It seems to sit quite naturally here; extending what you might want to do from an ANT script in a consistent/familiar syntax.

It could do much more, pretty much whatever Java can, though I’m not sure I’d be comfortable extending it’s project footprint too much.

Personally, I like the in built mark-up support… (But I’m funny that way.)

import groovy.xml.MarkupBuilder

def myXMLDoc = new MarkupBuilder();

    myXMLDoc.customer {
    	title(id:"001", "Mr");
    	forename("New");
    	surname("Customer");
    	address(type:"home"){
    		number("295");
    		addressLineOne("Fictitious Road");
    		addressLineTwo("");
    		town("Fake Town");
    		county("Notashire");
    		postCode("NO1 5NA");
    	}
    }

The above, in what seems to be a convenient and concise format, gives the following structure:

<customer>
   <title id='001'>Mr</title>
   <forename>New</forename>
   <surname>Customer</surname>
   <address type='home'>
     <number>295</number>
     <addressLineOne>Fictitious Road</addressLineOne>
     <addressLineTwo></addressLineTwo>
     <town>Fake Town</town>
     <county>Notashire</county>
     <postCode>NO1 5NA</postCode>
   </address>
</customer>

Whether this is truly useful or just an interesting diversion remains to be seen, at least for me. But, this is a great deal more workable than native Java alternatives.

The homepage for groovy can be found here and a first contact introduction to it can be found here.

Comments
No Comments »
Categories
development
Tags
groovy, java, xml
Comments rss Comments rss
Trackback Trackback

Simple URIReslover

Ian | March 25, 2008

I don’t mind admitting that despite it being pretty straight forward, I have been caught out by this more than once. So, in an attempt to prevent that Doh! moment again in the future…

The scenario revolves around an XSL Stylesheet that references another resource, be it an XML file for lookups, another stylesheet or whatever. Everything works a treat when processed locally, but blows up when invoked in its Java context. “Can not load requested doc:” or something similar.

This is where brain failure kicks in and I can’t think where the resource should be and waste time moving files around, changing references and trawling the web. In fact the reason the document cannot be found is simply because I haven’t told the transformer where, or more acurately how, to look for it!

The following is a simple reslover that looks on the class path for the missing file.

	public class ResourceResolver implements URIResolver {

		private static final String RESOURCE_PREFIX = "resource://"; 

		public Source resolve(String href, String base)
				throws TransformerException {
			if (!href.startsWith(RESOURCE_PREFIX))
				return null;
			try {
				if (log.isDebugEnabled()) {
					log.debug("Resolving stylesheet resource: " + href);
				}
				String resource = href.substring(RESOURCE_PREFIX.length());
				ClassLoader loader = getClass().getClassLoader();
				InputStream is = loader.getResourceAsStream(resource);
				return new StreamSource(is, resource);
			} catch (Exception ex) {
				throw new TransformerException(ex);
			}
		}
	}
Comments
No Comments »
Categories
development, software
Tags
java, xml, xslt
Comments rss Comments rss
Trackback Trackback

XSL “Is Numeric” too

Ian | February 27, 2008

Building on a previous post Oracle “Is Numeric” a similar thing is possible using XSLT (or more accurately, XPATH) too…

<xsl:if test="string-length(translate(node(),' +-.1234567890', ' ')) > 0">
  <xsl:text&gt;not numeric&lt;/xsl:text>
</xsl:if>

Not exactly ground breaking stuff, but something similar did turn out useful for extracting the non numerical area component of a post code (i.e. the SO bit of SO53 3RY).

substring-before(translate($postcode,'1234567890', '----------'),'-')

Which I thought was close enough to the oracle is numeric implementation to make comment.

Comments
No Comments »
Categories
development, software
Tags
xml, xpath, xslt
Comments rss Comments rss
Trackback Trackback

« Previous Entries

Author

Ian Robinson is a relatively agile software engineer interested in things both sides of the object relational divide and beyond.

Categories

  • development (37)
  • miscellaneous (28)
  • music (7)
  • software (19)

What I'm Doing...

  • @noelfielding11 why are you in watching telly!? in reply to noelfielding11 2010-04-16
  • What was so good about Nick Drake? These "artists" are covering, music is spot on but no effect at all. Totally lacking the goose pimples. 2010-04-16
  • Some Ginger bloke's on telly covering Nick Drake in a mediocre style. 2010-04-16
  • More updates...

Posting tweet...

Powered by Twitter Tools.

Blogroll

  • Dan North
  • Dave Astels
  • Dave Wood
  • eirikso.com
  • Matt Raible
  • Object Mentor Blog
  • The Ancient Art of Programming
  • The Wisdom of Ganesh

Tags

active-mq architecture bauhaus css db eclipse esb festivals freesat gorm grails groovy hd hibernate htpc java jboss jms junit links mce media center mini music oracle osgi patterns pirsig plugins satellite soa software spring sql struts2 testing themes tools tv vmc web wordpress xml xpath xslt
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox