XSLT  explanation

....Our first template matches "/", the XPath expression for the document's root element.
<xsl:template match="/">         // line1
<xsl:apply-templates select="greeting"/> // line2
</xsl:template>i have been stuck. actually, i want to know the role of "xsl:apply-templates" inside "<xsl:template".
Does the above wants to mean like below ?
line1: first find the root node/context
line2: under that root node/context if you find a node called "greeting" then apply the template for the "greeting" if it has been explained somewhere in the XSLT, otherwise do nothing.
am i right about the flow of these instruction in that code snippet?
in fact, my whole doubt is on the "<xsl:apply-templates select="greeting"/>" . i want to know the meaning of what it implicates.

I am having O'reilly's - Mastering XML
transformation book. its quiet good except they
dont give emphasis on this type small basic things. I found that most XSLT books provide poor explanations of basic things. When I first used XSLT it took me a day to just understand and get a 'Hello World' example running!
>
Any recomendation for good interesting XSLT book ?Sorry no! I'm sure others will provide you with a good reference. If you find one then please publish details.

Similar Messages

  • UDF in XSLT Mapping.

    Hi,
    Can I use a UDF in XSLT mapping. If yes, can anyone please guide me in the issue. When I searched the forum there is a discussion related to the attachment of Java classes to the XSLT mapping. Does this replace the use of a UDF ? Instead, can we opt for a Java Mapping. Which will be of more help? Kindly suggest your opinions with relevant explanation.  Thank you very much for your time.
    Krishna.

    Hi krishna,
    check this links
    http://www.topxml.com/rbnews/XML/re-55178_Remove-empty-nodes-in-BizTalk-by-using-XSLT.aspx
    http://www.topxml.com/rbnews/XML/re-55176_XSLT-performance-when-mapping-large-documents-in-BizTalk.aspx
    http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/frameset.htm
    XI: New features in SP14
    http://help.sap.com/saphelp_nw2004s/helpdata/en/d9/718e40496f6f1de10000000a1550b0/content.htm
    How to parse "XX/YY/ZZ;AA/BB/CC;11/22/33" in message mapping.
    What is UDF
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e55f9548dd
    Java Mapping (Part I)
    Difference in using java,xslt,message mapping
    Java Mapping (Part I)
    Java Mapping (Part II)
    Java Mapping (Part III)
    Testing and Debugging Java Mapping in Developer Studio
    Using JAXP to both parse and emit XML in XI Java mapping programs
    "JAVA MAPPING", an alternate way of reading a CSV file
    Think objects when creating Java mappings
    Regards
    srinivas

  • CX_SY_CONVERSION_NO_DATE_TIME XSLT Exception

    Hi,
    we're running ECC6.0 and created a Web Service(WS) out of a SAP-Function Module(FM).
    When calling this WS from Excel-VBA (XP; WS-Toolkit) the following error pops up:
    CX_SY_CONVERSION_NO_DATE_TIME: XSLT Exception An Error occured while deserialization in ST-program /1BCDWB/WSSA..............
    The value 4/6/2009 is not a valid date regarding XML-format for ABAP.
    (this is my translation from original german error message, so english error message may differ a bit).
    For explanation:
    The FM/WS should give me a table with fields of type DATS and I think the single transformation cannot convert 20090604 to 2009-06-04 but only to 4/6/2009.
    Any ideas would be great....

    Thanks for your feedback, Ralph.
    But, let me tell you that I tried again using a test tool for WebServices (soapUI 3.0.1, free software) and I got surprised to see that everything worked OK!, without errors (I had to previously clear "?" symbols and others "rare" values that the tool filled in for some parameters, nothing important).
    All of the Date fields were transfered to the BAPI, according to xml format for dates: "YYYY-MM-DD".
    So, I was able to avoid this "issue" by now, but I'm not sure what will happen until the real legacy sistem starts its owns tests.
    I have to wait until that moment to be sure. But according to test tool soapUI, if you use that format, it should work (I'm using SAP ECC 6.0). Let's see what happens in the end.
    May be there is some configuration or setting issue in the external/legacy system that calls your WebService.
    Regards,
    JG.

  • ***Calling Java finctions in XSLT MApping

    Hi All,
    How to  call java mapping functions in XSLT.I have created Value mapping function in java,want to call the same through XSLT.
    could you provide me  general XSLT prdefined functions with explanations that may be used commonly.
    Thanks,
    Srinivasa

    Hi Srinivas,
    Please see these blogs:
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    /people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt
    /people/kulwinder.grewal/blog/2009/08/21/xslt-runtime-value-mapping-from-integration-directory-using-xivmserviceclass
    /people/kulwinder.grewal/blog/2009/08/21/java-runtime-value-mapping-from-integration-directory-using-xivmserviceclass
    Regards,
    ---Satish

  • ANN: Indesign CS3 JS help to HTML using XSLT

    I felt quite at home with the previous CS's JS Help PDFs, but I'm not too wild about the ExtendScript editor. But if you don't use that, you miss out the online help! Fortunately, in one of the ExtendScript subfolders you can find an XML document with the slightly bizarre name "omv$indesign-5.0-en_us.xml". This contains the
    entire help document, in handy XML format.
    As an exercise, I wrote an extensive XSL stylesheet to convert it to fully cross-referenced HTML. This script is a bit too long to include here, but you can d/l it at
    http://www.jongware.com/binaries/indesign.xsl.
    Run it through your favourite XSL processor, and you get the whole thing in one huge file. Alternatively, you can select either a single class or enumeration (such as "TextFrame") or a single alphabetic letter ("A", just to provide an example, will process all classes and enums from "AlignDistributePreference" to "AutoEnum"). In these cases, the hyperlinks will (obviously/unfortunately) fail.
    It is quite possible to load the 113,000 line XML into InDesign and apply formatting to it, but I think I'll leave it at this.

    I sure had fun 'tokenizing' the "Can accept: xx, yy or zz" remarks for the "any" value into separate entries :) Only for Properties, though, since with most of the Methods you changed the wording. Please, for the next version, a list of these possible elements in the XML!
    Some new items added: a full index (only if you check it in the XSL--it's quite long); more importantly, per class a list of "Element of", "Returned by", and "Used in", all hyperlinked to the extreme -- now you can see at a glance how all elements link together! These lists are not
    entirely complete (that's your (Ole's) fault, because of that "any" notation).
    [PS: there seem to be no explanation of function return values...]
    I understand the idea of the SVG block diagrams, and if I feel the urge (and have an example of what it should look like) I might give that a try -- just for laffs. In the mean time I'm finally gonna upgrade my CS1/2 scripts, using my own HTML to guide me :)
    For the XSLT impaired amongst us, d/l the complete HTML page at jongware.com:
    indesign.zip (3.5MB, zipped to 471Kb). Enjoy!

  • Accessing runtime constants with XSLT doesn't work

    Hi PI-experts,
    I'm trying to insert the Message ID from my message in a XSLT Mapping. I followed the description in SAP Help:
    First declare a param:
    <xsl:param name="MessageId"/>
    Later, use it:
    <MESSAGE_ID><xsl:value-of select="$MessageId"/></MESSAGE_ID>
    But the field MESSAGE_ID is always empty.
    Any explanations ?
    What do I need to do, to make it work ?

    Hi Udo and all,
    i have a bpm, where i first collect some messages and then execute a transformation step, which calls a XSLT Mapping to merge multiple messages into one. After this Transformation Step i added another Transformation Step, which calls a Message Mapping. This Message Mapping is a one to one mapping (every field in the source gets mapped to its twin in the target structure, both messages are the same). Only one field is changed, i wrote user-defined function as proposed in Michal's blog, retrieve the MessageID and set it to this field. I tested the BPM and it definitly works, the Message ID is set to the correct value.
    Is this a different behaviour than you have experienced in the past?
    I'm running on PI 7.0 with SP 16.
    Best Regards
    Sven

  • Using XSLT to extract value of a XML node with namespace

    I have a XML source code here.
    <?xml version="1.0" encoding="utf-8" ?>
    <rss version="2.0" xmlns:job="http://www.pageuppeople.com">
      <channel>
        <title>SMH Jobs</title>
        <link>internalrecruitment.smhgroup.com.au/jobsrss.ashx?stp=di</link>
        <description>A listing of jobs available here</description>
        <item>
          <title>eCommerce Optimisation Advisor</title>
          <description>A new and exciting opportunity exists for an experienced eCommerce Advisor to join</description>
          <job:location PUReferenceID="3711">Sydney - Inner Suburbs & CBD</job:location>
        </item>
      </channel>
    </rss>
    I want to use XSLT to extract value of a XML node with namespace <job:location>, and the returned value should be string 'Sydney - Inner Suburbs & CBD'. I tried a few XSL code below, but failed with error or nothing was returned.
    <xsl:value-of select="job:location" disable-output-escaping="yes"/>
    <xsl:value-of select="job/location" disable-output-escaping="yes"/>
    <xsl:value-of select="job\location" disable-output-escaping="yes"/>
    <xsl:value-of select="location" disable-output-escaping="yes"/>
    This might be an easy question for you, but I would appreciate if anyone can help.

    Hi Suncorp IT Learner,
    We need to tell the XSLT that some elements are in another namespace. Copy the xmls declarations for the prefixes you need to use. Then use the xsl format as:
    <xsl: value-of select=”job:location/@PUReferenceID”/>
    In following issue, Chriztian has a good explanation:
    http://our.umbraco.org/forum/developers/xslt/33353-XSLT-reading-XML-attribute-value
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Calling FM in external system from XSLT

    Hi,
    I know that in XSLT interpreter provided by SAP supports calling function modules.
    I need to call FM in external system from XSLT in message mapping and its result insert into one of element result XML message.
    Do you think it is possible ?
    If so is available any documentation for that.
    Any help is appreciated.
    Thank you.
    Marian Morzol

    Hi Vijaya,
    this is very helpfull document for me. However I need some other explanation.
    Does it meen that I need to write "Helper java class" ( e.g. in text editor - Notepad) and deploy the source to to Entegration Engine directory or an Adapter Directory ( maybe using Visual Administrator).
    It is not clear for me.
    I have XI 3.0 running on Windows 2003 Professional so to copy some files to some folders should not be a problem but I need an exact guide what I have to do.
    Thank you.
    Marian

  • Table or list for icon images and their explanation?

    Hello,
    In our user manuals we have descriptions of icons next to the respective icon image. Until now I've always used a table, but the predefined table elements in DITA don't allow for a narrow first column and wider second column. I appreciate any suggestions how I can do this in structured FM.

    Hi ABJB,
    I don't know enough about DITA to say whether it should or should not be possible to set custom table widths. I do remember working with the spec in the past and there was something about a lack of attributes in which to store table widths, so I had to borrow some other attribute and do some fancy XSLT work to jam the data into another attribute. Anyway, the relevant point is that someone either needs to tell you how it can be done, or, if it cannot be done, then you can either:
    - Modify the DITA structured application to make it store table widths, so the data is preserved when it goes to XML and back
    - Use your own custom structure definition
    By the way, I'd like to clarify something about "structured FM"... Structured FM is the same old FrameMaker you've always known, except that structural markup is applied to your content and gives you lots of help with the automation of format. So, you can make column widths whatever size you want, tables look however you want, etc., and when you save to binary *.fm format, all the layout is naturally preserved. In your case, though, you are attempting to use structured FM to edit XML files, which is somewhat of a different story. The structured interface is very good for this and when everything is properly configured, XML files open up looking like normal FM structured documents (like the DITA XML files). However, for lots of formatting properties such as table widths, there must be some kind of instruction behind the scenes that tells how to write that data into the markup, otherwise it is simply lost. It is possible that the DITA structured app (and the DITA spec) lacks that ability and hence the column width data is lost when the content goes to XML.
    So anyway, that's a long windy explanation to emphasize that nearly anything that is possible in unstructured FM is possible in structured FM. It's when you start saving in XML format that you have to account for formatting artifacts.
    By the way... do you need XML for anything? Lots of people find that structured FM alone serves their needs.
    Russ

  • Xslt mystery.  Works in one environment, not the other

    Has anyone come across the following?
    First, clarification: The environments, though physically different are essentially the same. same os, libs, version of java, application server, etc. The difference is the one in which it works is at my workstation, and where it doesn't is our lab. All the simple explanations have been investigated (no view private files being picked up vs version controlled, library versions, etc).
    I don't believe I even need to explain the functionality. Basically:
    <xsl:template match="/name1/name2">
    works (ie matches the node) at my desk while it doesn't in the lab.
    Everything else is the same. The xslt executes in the lab. There are no exceptions. Debug statements verify the xml being parsed is the one being processed. But this template is never invoked, so it falls back to the
    <xsl:template match ="@*|node()">
    template.
    I checked the System.property javax.xml.transform.TransformerFactory to see if maybe they had a different implementation than at my workstation, but the value was the same; no value, which means we are both running the default transformer. We are also running the same java (1.5.0_06_b05).
    Any ideas of what/where to look? I realize that I haven't given alot of info, but that's because EVERYTHING is the same.

    Ok, I found the difference that is causing the xslt not to work. But this just makes it more confusing. The scenario where it DOESN'T work seems as if it should, and the scenario in which id DOES work seems as if it shouldn't!! Is there anyone who might be able to explain the behavior.
    First, the xslt's. In both environments they are exactly the same. Both have a default namespace defined: ie xmlns="some uri A"
    In Environment 1
    There is no default namespace defined in the xml; that is there is no xmlns="any uri". However, there is a prefix defined
    xmlns:xis="some uri A"
    (note, "some uri A" points to one of our own defined schemas and is the same in both the xslt and xml)
    In Environment 2
    There is a default namespace defined in the xml exactly as is defined in the xslt.
    So, when an xml document comes in that has
    <abc>
    <def/>
    </abc>
    And the template is
    <xsl:template match="/abc/def">
    I would think that environment 1 wouldn't match, because there is no default namespace defined, but the template does define a default namespace, "some uri A" which I think is applied to the /abc/def. But this is the case that works. I'd expect to have to use <xsl:template match="xis:/abc/def">
    I'd also think that environment 2 would match, because the xml and xslt both define the same default namespace, so /abc/def means /abc/def, but this is the case where it doesn't work.
    Can anyone set me straight on what is going on here? Sorry I don't cut and paste the source, but I can't. It's really this simple. In environment 1, if I remove the xis from the namespace definition in the xml, it "breaks" and works the same as in environment 2.

  • FileName in ABAP XSLT Mapping

    Dear SDN,
    In an integration scenario we are using sender File Adapter and a  ABAP XSLT Mapping.
    Is there any way to get the source FileName from such mapping.  Im trying to use the adapter-specific message attributes, but it doesn't work, and I didn´t find an example, probably I and doing somthing wrong.
    regards,
    GP

    Thank you for your help,
    I just try to access the adapter-specific attibutes using:
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:variable name="filename"  select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
    </xsl:stylesheet>
    but the following error raised:
    <SAP:Stack>Error while calling mapping program YXSLT_TEST (type Abap-XSLT, kernel error ID CX_XSLT_RUNTIME_ERROR) Call of unknown function</SAP:Stack>
    have you had this situation?

  • How can I display XSLT transformer errors on a web page ?

    Hi,
    I have some JSP pages that access DB, create an XML based on DB data and then transform it into HTML through an XSLT stylesheet. Developing the XSL code it's easy to make mistakes and generate errors on trasformation, but what I receive on the web page is only a "Could not compile stylesheet" TransformerConfigurationException, while the real cause of the error is displayed only on tomcat logs. This is the code for transformation:
    static public void applyXSLT(Document docXML, InputStream isXSL, PrintWriter pw) throws TransformerException, Exception {
            // instantiate the TransformerFactory.
            TransformerFactory tFactory = TransformerFactory.newInstance();
            // creates an error listener
            XslErrorListener xel = new XslErrorListener();
            // sets the error listener for the factory
            tFactory.setErrorListener(xel);
            // generate the transformer
            Transformer transformer = tFactory.newTransformer(new SAXSource(new InputSource(isXSL)));
            // transforms the XML Source and sends the output to the HTTP response
            transformer.transform(new DOMSource(docXML), new StreamResult(pw));
    }If an exception is thrown during the execution of this code, its error message is displayed on the web page.
    This is the listener class:
    public class XslErrorListener implements ErrorListener {
        public XslErrorListener() {
        public void warning(TransformerException ex) {
            // logs on error log
            System.err.println("\n\nWarning on XEL: " + ex.getMessage());
        public void error(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nError on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
        public void fatalError(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nFatal Error on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
    }When I have an error in the XSL stylesheet (for examples a missing closing tag), I can find on tomcat logs the real cause of the error:
    [Fatal Error] :59:10: The element type "table" must be terminated by the matching end-tag "</table>".
    Error on XEL: The element type "table" must be terminated by the matching end-tag "</table>".but on my web page is reported just the TransformerConfigurationException message that is:
    "Could not compile stylesheet".
    How can I display the real cause of the error directly on the web page?
    Thanks,
    Andrea

    This code is part of a bigger project that let developers edit XSL stylesheets through a file upload on the system and we can't impose the use of any tool for checking the xsl. So, I need to display the transformer error on the web page.I see. This code is part of an editorial/developmental tool for developers to create and edit XSL stylesheets.
    As part of the editorial process, XSL errors during editing can be considered a normal condition. In other words, it is normal to expect that the developers will generate XSL errors as they are developing stylesheets.
    In this light, handling the XSL transformation errors is a business requirement that you need to handle. Using the Java Exceptions mechanisms, e.g. try / catch are inappropriate to handle business requirements, in my opinion.
    I suggest that you look at how you handle the occurence of XSL errors differently than what you currently have. You need to:
    (1) capture the Transformation exception on the server;
    (2) extract the message from the exception and put it into a message that can be easily understood by the user;
    The current error message that you have going to the web browser is not useful.
    And you should not have the Transformation exception sent to the web browser either.
    What you are attempting to do with the exception is not appropriate.
    Handle the Transformation exception on the Business tier and use it to create a useful message that is then sent to the Presentation tier. In other words, do not send Java exceptions to web browser.
    />

  • Extensions like Ghostery, WOT or AdBlock stop working after two or three times. Restarting the webpage in a new tab the extensions will work again for several times and then stop again. Has anybody an explanation or a workaround for this bug in Safari 5?

    Extensions like Ghostery, WOT or AdBlock stop working after two or three times. Restarting the webpage in a new tab the extensions will work again for several times and then stop again. Has anybody an explanation or a workaround for this bug in Safari 5?

    Remove the extensions, redownload Safari, reload the extensions.
    http://www.apple.com/safari/download/
    And if you really want a better experience, use Firefox, tons more choices and possibilities there.
    Firefox's "NoScript" will block the Trojan going around on websites. Best web security you can get.
    https://addons.mozilla.org/en-US/firefox/addon/noscript/
    Ghostery, Ad Block Plus and thousands of add-ons more have originated on Firefox.

  • I am trying to set up Sharing amongst several computers on my home network.  I have followed all the setup instructions but after completion Sharing does not appear in my iTunes window (on any of the computers I've set up).  There is no explanation why.

    I have been trying to set up Sharing between two computers on my network. I did this once and it worked.  However, when I try to set this up now the Sharing feature does not appear on the left side of the iTunes window (on either computer).  There is no explanation as to why not.  Is this a configuration problem, a network problem or what?   Can it be fixed?  I have tried turning sharing off and back on on both computers but to no avail.  What am I missing?  Thanks for any help you can provide.

    Hey innerev2003,
    Thanks for the question, and welcome to Apple Support Communities.
    If, while searching through your past purchases, items are unavailable to download and show a "Purchased" button, they are still on your computer. It may be best to search your iTunes library by clicking Music, then use the search bar at the top right.
    If you are completely sure the items are no longer in your library, try signing out of the iTunes Store, and then back in.
    iTunes 11 for Windows: Manage your iTunes Store account
    http://support.apple.com/kb/PH12507
    Thanks,
    Matt M.

  • Help/explanation needed - Using an external hard drive

    Hi everyone,
    I bought an external 250gb hard drive as my MBP was very close to full capacity. Yesterday, I had a bit of a scare...
    1. I backed up my Aperture Library onto the external hard drive.
    2. I had about 500 of my favourite images rated 5 star and so I selected these and set up a new project.
    3. I went through my Aperture library deleting folders/projects that I have completed.
    4. I went back into the 5 star ratings and they did not exist. I assume this is because I deleted the master files.
    5. I wanted to have the 5 star images on my laptop and so I connected my external hard drive once again. [This is where I felt I lost control and understanding of what was going on].
    6. I looked for the seperate Aperture files but could only find a file called Aperture Library. I clicked on this but nothing happened at all [I had thought that it would open up Aperture with the previous library].
    7. I dragged the library onto my desktop and waiting for all the images to reload onto my laptop. I then saw that everything was as it was previously, i.e. all the files and images existed. However, my hard drive space was even lower [I assume this was because the current workflow that I had left on the laptop was now duplicated?].
    8. Then I got a message saying my iDisk space is critically low and may damage my Aperture library. Moments later the majority of my images disappeared and a red space appeared where every photo had previously been. Since I have 2 weddings that I am yet to deliver I was very panicked. I tried to drag and drop the Aperture library once again and the message came back that the operation could not be completed due to the current file already existing.
    9. I unplugged the external hard drive and the photos re-appeared [much to my delight]. However, my concern is that I really don't understand what happened and more importantly why. I will need access to the data on the external hard drive in the event in the near future and am worried that the same thing will happen next time I connect it.
    As a result of all this I have some questions, as follows:-
    - Have I adopted the completely wrong approach to backing up data?
    - Can the master files be compressed as I shoot RAW and these are huge files?
    - Why could I not use the Aperture library stored on the external hard drive without downloading it back onto the laptop?
    and a more general question about file storage...
    - I am confused as to how much hard drive space is being used on my MBP. I have 13gb in Aperture, 1gb in iTunes and 1gb in iPhoto. However, I only have 50gb available, so half the capacity is currently being used. I know that Aperture and Garageband applications use about 10gb between them and there is of course the operating system, but 50gb in total seems a lot. On investigation in the finder screen I see that on my personal drive the Aperture, iTunes and iPhoto data is stored there. However, it is also stored under pictures and music respectively. Does this mean that it is storing duplicate copies of this data and that is the explanation for such high hard drive usage? If this is the case, can one be removed?
    I appreciate that this has been a long email, but I felt it was important to illustrate the steps I have taken. As you will no doubt glean from this post I am not the most computer literate person. Any help/explanation would be most appreciated.
    Many thanks,
    Jamie

    Hi Jamie.
    I am not sure what went wrong with your setup but I will let you know my configuration as an example and you can decide if you think it is a good way to have it. I am asuming you are using ver 1.5?
    Like you I have only a Laptop (G4 17" 1.5Ghz 2 Gig Ram - would love a macbook) so hard disk space is a premium. I also have an external firewire drive to hold all the HiRes RAW images. When I download my images from the Camera I do it manually into folders on the external drive (Cataloged by Date and maybe description of location). I then Import the images from those folders into Aperture but use the option when importing to "Store Files - In their current location".
    My Aperture library file is on my laptop so all that it has to store is the "Preview" file that gets generated automatically (in the preferences I have it set up to the resolution of my laptop 1440pix so that if I did a slide show it is only as big as my screen - anything more is a waste of disk space IMO.)
    I do it this way so that it is easy to find and work on my files with other programs such as Photoshop by going straight to the image rather than exporting from Aperture.
    Obviously I cant edit the RAW files while the drive is disconnected but I can still do ratings and keywords without the original files being there.
    I hope this helps.
    Regards
    Andrew
    G4 17inch   Mac OS X (10.4.8)   2 Gigs RAM

Maybe you are looking for