Replacing HTML elements?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fifthcadence
    New Member
    • Sep 2008
    • 4

    Replacing HTML elements?

    Hi,

    How can I use a XSL stylesheet for input 'blah' to output the HTML element iframe?

    Thanks,
    fifthcadence
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    this depends upon whether 'blah' is xml, because xsl stylesheets usually work on xml files.

    If you could describe your problem in more detail, I might even be able to say something more helpful.

    regards

    Comment

    • fifthcadence
      New Member
      • Sep 2008
      • 4

      #3
      I suppose it will be a XML stylesheet.

      I'm completely new at this field, so I won't know how to describe my problem. Any code that you suggest, I will try.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        then let's start with the beginning. What does your input look like?

        regards

        Comment

        • fifthcadence
          New Member
          • Sep 2008
          • 4

          #5
          I don't know how to write the input...

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            Replacing HTML elements?

            then one step back, what input content do you have? (once you know what you have and what you need, you can design the xml)

            Comment

            • fifthcadence
              New Member
              • Sep 2008
              • 4

              #7
              If it was simply an 'iframe', what would its output be? May I see an example?

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                Originally posted by fifthcadence
                If it was simply an 'iframe', what would its output be? May I see an example?
                though I doubt that this will solve the problem, it may demonstrate how it is done in general (that’s only one possibility)
                Code:
                // xsl headers
                <xsl:template match="$content"> 
                // $content = the element in your xml file that contains what you want to put in the iframe
                <iframe>
                  <xsl:copy-of select="."/>
                </iframe>
                </xsl:template>
                if you want to read from an iframe you have to make sure the source documents are at least well-formed xhtml.

                regards

                PS xhtml to xhtml transformation is (in general) described here.

                Comment

                Working...