Subject:XSLT Logic to Trucate elements to 250 charaters in an XSD Author:Ali Ebrahim Date:17 Dec 2006 09:50 PM
Hi All,
I'm new to XSLT and Stylus Studio and would like to know how the following is possible.
I have an XSD from my client that has very lengthy <xsd:documentation> elements. Our CRM Product is Siebel and we need to import this external xsd into Siebel. Siebel has a restriction on documentation length to a max of 250 charaters.
Is it possible and if so How do I execute some logic against the external xsd to truncate all <xsd:documentation> to a length of 250 characters in Stylus Studio.
Subject:XSLT Logic to Trucate elements to 250 charaters in an XSD Author:Ali Ebrahim Date:17 Dec 2006 11:57 PM
Hello Ivan,
Thanx for all the assistance, it worked well.
This is what I have done....
1) Open Stylus and New>XSL Stylesheet
2) In the Source XML, I selected the XSD that I would like to run the script on
3) In the XSLT Source I pasted in your XSLT script and executed
The script only changed the file I selected.
The client’s schema is made up of a number of xsd and they are included in a main xsd.
Is there anyway by running your xslt script against the main xsd the script, all included xsd's will be looked at and the documentation element will be checked or would your script need to be changed?
The client’s main xsd looks similar to:
<xsd:include schemaLocation="xml_Header_r1.xsd"/>
<xsd:include schemaLocation="xml_Common_r1.xsd"/>
<xsd:include schemaLocation="xml_Loc_r1.xsd"/>
<xsd:include schemaLocation="xml_SP_r1.xsd"/>
<xsd:include schemaLocation="xml_SO_r1.xsd"/>
<xsd:include schemaLocation="xml_SD_r1.xsd"/>
<xsd:include schemaLocation="xml_CR_r1.xsd"/>