• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

xslt

 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
How difficult is writing my validation tool with XSLT or with Java.

If i use Sun MSV or someother tool,i can't get customized information,i mean my end user can't
understand if it throws error like "Element<contactname> of complextype <Name> is mandatory"

But with XSLT,I can do that by writing stylish validation error.
How far its correct ?Is it very difficult to check datatyping and all with XSLT?

Would be happy if anyone would share your ideas on this.
I was asking this question for more than 4 months back.

Please reply.
Regards
Balaji
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to parse XML Schema once and my impression is that while it isn't such a big challenge to access Schema in XSLT, to get it 100% correct is a real challenge. You need to consider all possible variants/special cases, you probably need a large test suite etc. if you are to write your own generic validating tool, then it's probably safer to leave it to big guys
But if you need to deal only with one particular case, then it may work well for you. For not to start from scratch, you can reuse stylesheets from Wrox's "professional XML Schema" chapter 10. They have generic stylesheets to document schema and to create an HTML form to edit an instance document. I believe you can download the code from Wrox site.
Another approach would be to abandon Schema and to write your own validating XSLT. Here is a relevant article by Rick Jelliffe.
Yet another approach, I remember some validating tools outputted errors as XML, so instead of writing your own validation mechanism, perhaps you could "translate" their output into something more readable.
----------------------
"As you probably guessed from the chapters so far, the answer to all our problems is XML."
"Web Service Facetplates". Wrox, 2002
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is another XSLT stylesheet to read a Schema and output documentation. But you do not want to reuse it, it is 285K length! This is the biggest XSLT I've ever seen! An average page of text is about 2K long, so this piece of work is 130-140 pages! How did they debug it?
----------------------
"As you probably guessed from the chapters so far, the answer to all our problems is XML."
"Web Service Facetplates". Wrox, 2002
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Map,
Thanks a lot for replying even on the weekends.The reply is very helpful.
I found only XSV(http://www.w3.org/2001/03/webdata/xsv) is outputing XML as error message
after checking instance against schema.If you know someother tool,please post the link here.
The problem with the XSV is its in Python and my envt is servlet/jsp with IIS.
So i think using XSLT is wise at this stage.Presently i'm reading chap 10 of professional XML schema to apply it.

How far you think the approach of writing validating tool with XSLT by abonding Schema.My Schema is not going to change much. I'm afraid i shd not get commented by people for this approach in future.
I would like to give another try for making MSV to work with servlets than on command line.
Just a 44kb style sheet driving me nuts,285 kb ...
Let me work out with all possiblities and comeout with more questions
thanks again.
Regards
Balaji
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How far you think the approach of writing validating tool with XSLT by abonding Schema.
There is a good supporting tool - Schematron. It is really easy to use, but documentation looks daunting... There should be a good tutorial somewhere
Ah, maybe this: http://www.xml.com/lpt/a/2000/11/22/schematron.html
[ August 12, 2002: Message edited by: Mapraputa Is ]
 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic