Performing XML Transformations in Flex

前端 未结 2 1359
借酒劲吻你
借酒劲吻你 2021-01-15 01:51

I\'d like to be able to run an xml transformation using an xslt file in my AIR project. What\'s the best way to accomplish this?

2条回答
  •  鱼传尺愫
    2021-01-15 02:34

    In AIR 1.5, a version of Webkit with support for XSLT is included.

    Use the class XSLTProcessor from JavaScript just like you would in Firefox. (Note: There is one annoying bug. Stylesheets cannot contain non-breaking spaces, no matter whether literally or as a character reference. I am told that more recent versions of Webkit will fix this issue.)

    Below is a complete example.

    Create a file test.html

    
      
        XSLT test
        
      
      
        
        Output:
      
    
    

    and a file test.xml

    
      test
      test
      
        test.html
        true
      
    
    

    You can try it using the debugging runtime, for example:

    adl test.xml
    

    Klick the button, and it will say:


    (source: lichteblau.com)

提交回复
热议问题