[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Why do some people not use XSLT to process XML-fo
Hey Roger, As a long-time XSLT evangelist, I'm often struggling with the resistance to using XSLT on XML/JSON/other structured data. I've found that the reason for this resistance is a combination of the following: a) XSLT is outside of most developers' comfort zone b) Some people are familiar with XSLT 1.0 only and base their opinions on that early, more limited version c) People are comfortable with generating technical debt with many tightly-coupled pieces (i.e. XML-to-Java marshalling) I try to use these arguments against that resistance: i) By using XSLT/XPATH to describe business rules / business logic, it's easier to separate the technical logic and the business logic ii) XSLT/XPATH are available in many host languages (Java/Javascript/C/Python/C# and all of their variants like Kotlin/Scala) which means that you can port your XSLT code to other languages much more easily iii) By using XSLT, you can eliminate a lot of the technical debt that Java marshalling creates iv) XSLT/XPath are highly reusable and retargetable .. it's and incredible longterm gain I think that it's a very good idea to put an early project on the right path. The benefits are enormous. Good luck with it On Sun, Nov 3, 2024 at 4:47b/AM Roger L Costello costello@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > Hi Folks, > > I am working on a project that has created a large XML Schema. The > creators of the XSD deliberately avoided using xs:choice and several other > XSD constructs (instead of xs:choice, they used xs:sequence containing > optional elements). They did this because: (1) the XML documents -- which > conform to the XSD -- will be processed by Java, and (2) the skeletal > structure of the Java is to be auto-generated from the XSD using a data > binding tool and the data binding tool doesn't support xs:choice and the > other XSD constructs. > > Thus, a limitation in the data binding tool dictated how the XSD was > designed. > > If they were using XSLT to process the XML, then the creators of the XSD > wouldn't have been under the limitation, i.e., schema-aware XSLT has no > problem with xs:choice or any other XSD construct. > > I don't understand why anyone would not use XSLT to process XML documents. > The XSLT language was explicitly designed for processing XML documents, > i.e., XSLT is a domain specific language (DSL). When a DSL exists, > shouldn't it always be chosen over a general-purpose language such as Java? > > The project is in its early stages. There might be an opportunity to > convince people to use XSLT rather than Java. What argument should I make > to persuade them to use XSLT? > > SAXON processes XSLT using Java. Why? Why doesn't SAXON use XSLT to > process XSLT? Should I infer that the XSLT language is not powerful enough > with certain types of programming? > > /Roger
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|