IMG tag and XML syntax

Hi,
I want to dynamically embed image url into the IMG tag as follows:
<jsp:useBean id="image" scope="request" class="mybeans.ImageBean" type="mybeans.ImageBean" />
<img src='<jsp:getProperty name="image" property="imagePath"/>'    />The problem arises because of confusion with closing/opening tags getting mixed up.. How do I get this code to work if i'm using xml syntax in my jsp pages? Any solutions?
P.

It would be complaining about using a tag as an attribute to another tag.
ie nesting a tag within the tag, rather than between open/close tags for it.
Solution? Don't nest tags like this. I'm figuring you have to use an expression of some sort.
either <img src='<%= image.getImagePath %>'/>
or using EL in a JSP2.0 container:
<img src='${image.imagePath}'/>
I can't say I have done strict xml stuff, so I might be a little off, but thats the general idea.
Hope this helps,
evnafets

Similar Messages

  • Delete xml messagetype tag and xml versioning tag in target xml file

    Hi experts.
    i want to delete the xml version, starting (<MT_ZMPSSERRMSGMST_SEND>*and ending </MT_ZMPSSERRMSGMST_SEND> tags in below message.
    here i am bold the tags which i want to delete. please help me how to delete this.
    <?xml version="1.0"; encoding="UTF-8"?>
    <MT_ZMPSSERRMSGMST_SEND>
       <MESSAGE>
          <TABLENAME/>
          <ACTION/>
          <RECORD>
             <ERRORID/>
             <ERRCLASSID/>
             <SHORTDESC/>
             <DESCRIPTION/>
             <RESOLVE/>
          </RECORD>
       </MESSAGE>
    </MT_ZMPSSERRMSGMST_SEND>

    Hi Srinivas,
    You can delete the required content of the XML by editing the XML.
    Develop a custom adapter module and use the below code to edit the xml and deleting the highlighted content
    // to read the input XML
    strData = xmlData.getText();
    // get the length of <?xml version="1.0"; encoding="UTF-8"?> <MT_ZMPSSERRMSGMST_SEND>
    int strheaderlength = (strData.substring(0,strData.indexOf("<Message>")).length());
    // read the data from <MESSAGE>  to </MESSAGE>
    String payload=strData.substring(strheaderlength,strData.startIndexOf("</MT_ZMPSSERRMSGMST_SEND>"))
    // set the new payload to xmlData
    xmlData.setText(payload);
    appreciate if useful

  • Using itemtype img tag and meta tag with {tag_largeimage}

    Hi everyone
    Just getting into using Social Media meta Tags for my online store using bc
    Schema.org markup for Google+
    Twitter Card data
    Open Graph data
    and I used this site for reference Must-Have Social Meta Tags for Twitter, Google+, Facebook and More - Moz
    Ive added this to my large product page and now ive entered the world of Schema.org markup and itemtype and im having trouble with images.
    for my large product page ive turned the meta tags from this...
    <meta itemprop="image" content="http://www.example.com/image.jpg">
    <meta name="twitter:image" content="http://www.example.com/image.html">
    <meta property="og:image" content="http://example.com/image.jpg" />
    to this
    <meta itemprop="image" content="{tag_largeimage}">
    <meta name="twitter:image" content="{tag_largeimage}">
    <meta property="og:image" content="{tag_largeimage}" />
    but the page doesnt like it and the page reads with 3 /> /> /> at the top of my html page for anyone to see meaning that bc doesnt like the code.
    also doesnt like it when i use
    <img itemprop="image" {tag_largeimage}" />
    turns into this
    <img alt="" itemprop="image" />
    Image is the only one im having a problem with so far any ideas if I can do anything about it. I dont want to have to manually add a http to every product.
    thanks
    Dave

    the meta tags work now.
    the only one i still cant get to work is the
    <img itemprop="image" {tag_largeimage}" />
    when I change it to _path the html editor saves it as
    <img alt="" itemprop="image_path" />
    so will have to leave that for now put I can still use alot of the itemprop tags to promote the page better than before.
    thanks for the help

  • HTML img tag and src attribute as a byte[]

    Hi everybody
    I have a question is it possible to send a byte[] to the src attribute in a <img> HTML tag. What i would like to gain is a way of reading an img file from the jar in a custom tag which is no problem. Problems start when i want to send a byte[] which I have read from the InputStream to the StringBuffer which contains the HTML code.
    byte[] dataByte = null;
    String charEncoding = "UTF-8";
    InputStream in = imageURL.openStream(); //InputStream to the img file inside a jar
    StringBuffer buffer = new StringBuffer();
    StringBuffer sb = new StringBuffer();
    String imgData = "";
    int data;
    while((data = in.read()) != -1)
    buffer.append(new Integer(data).toString(), charEncoding);                              
    imgData = buffer.toString();
    dataByte = imgData.getBytes();The problem starts in this line, i think i need some encoding to do this.
    sb.append("<img src=\""+dataByte.toString()+"\">");thx in advance

    I know that u can do something like that :
    <html>
    <body>
    </body>
    <IMG
    SRC="data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7"
    ALT="Larry">
    </html>I want to do exactly the same thing but via custom tags. The problem is as u say i have some data in the src attribute but the web browser doesn't interpret it right. sory for the long html source.

  • Unclosed meta/img tag. Output method= xml / xhtml / xml

    Hello,
    Im trying to parse from a Document to an String, in the usually way, as follows:
        public static String parseDocument(Document document) {
            try {
                if (document== null) {
                    return null;
                TransformerFactory tFactory =
                        TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                DOMSource source = new DOMSource(document);
                StringWriter sw = new StringWriter();
                StreamResult result = new StreamResult(sw);
                transformer.transform(source, result);
                String xmlString = sw.toString();
                return xmlString;
    //TODO: error handling
            } catch (TransformerConfigurationException ex) {
                return null;
            } catch (TransformerException ex) {
                return null;
            } catch (Exception ex) {
                return null;
    }Ive maked a test that creates a Document:
      public static Document createFromDoc(){
            try {
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();
                DOMImplementation impl = builder.getDOMImplementation();
                Document doc = impl.createDocument(null, null, null);
                Element root = doc.createElement("html");
                doc.appendChild(root);
                Element head = doc.createElement("head");
                root.appendChild(head);
                Element meta = doc.createElement("meta");
                meta.setAttribute("http-equiv", "Content-Type");
                meta.setAttribute("content", "text/xml");
                meta.setAttribute("charset", "UTF-8");
                head.appendChild(meta);
                Element title = doc.createElement("title");
                head.appendChild(title);
                Element body = doc.createElement("body");
                root.appendChild(body);
                Element div = doc.createElement("div");
                div.appendChild(doc.createTextNode("Created with docs."));
                body.appendChild(div);
                return doc;
            } catch (ParserConfigurationException ex) {
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                return null;
        }Well, you can see the test method "prueba1". Y:
        public static void prueba1(){
            Document doc1 = Main.createFromDoc();
            //String doc2 = Main.createFromString();
            String doc1Str = GestorXMLDoc.parseDocument(doc1);
            return;
        }Why my method public static String parseDocument(Document document) adds this extra meta tag when it transforms a Document to an String:
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    and modifies the other meta tag as follows (I mean, unclosing it):
    <meta charset="UTF-8" content="text/xhtml" http-equiv="Content-Type">
    You can see the full String result:
    <html>
    <head>
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8" content="text/xhtml" http-equiv="Content-Type">
    <title></title>
    </head>
    <body>
    <div>Created with docs.</div>
    </body>
    </html>I tried parsing with a fake XSLT Template with output: XML, and it doesnt works. I tried changing the meta content data with "text/xml".
    This method makes the document not compatible with XML, because it doesnt close the meta tag. I need work with this XHTML doc as a valid XML document, not as a HTML (W3C allows set meta/link/img tags unclosed) to add new nodes.
    Thank you ppl =)

    First of all, what you are trying to do is transforming, not parsing. Parsing is converting an XML document into an internal form, and you already have the XML in the internal form (org.w3c.dom.Document).
    Anyway, XSLT has special rules for transforming a document whose root element's name is "html". It looks like those rules are being applied in your case. If you don't want them to be applied (which you don't if you are producing XHTML) then you have to tell the transformer you want XML as your output and not HTML.
    If you had an XSLT document you would use <xsl:output method="xml"/>, but you don't have one in this case. So you do it like this:
    transformer.setOutputProperty(OutputKeys.METHOD, "xml");

  • XML syntax for tags

    It has always been a habit of mine to use XML syntax for CF tags since I've been working with XHTML. For instance, I will do <cfset var myVar = "" /> However, I noticed when doing <cfdump var"#myvar#" />, the output is displayed twice. So now I am wondering if whenever I use a /> on something such as cfset, is the tag actually executing twice? How does this affect performance?
    I just happened to notice that in CFBuilder, when I do <cfargment name="myVar" required="true" type="string" default="" />, when I go to the next line and start typing <cfarg auto-suggest will select the cfargument tag, but this is only if I use a />. If I omit the ending forward-slash, auto-suggest does not work. That may be a setting specific to CFBuilder, but that wasn't the scope of this question.
    What syntax is correct and how does it affect performance?

    According to the document I've linked to below; using self-closing CF tags, such as <cfset myname="Bob" /> is permissible.  The document also notes exceptions to this such as CFIF and custom tags as examples where a self-closing tag shouldn't be used.
    http://livedocs.adobe.com/wtg/public/coding_standards/style.html
    Althoguh it doesn't look like it, that's an internal coding standard for one of Adobe's (well: it was Macromedia at the time) internal teams, and is not supposed to be a suggested standard for everyone.  I've had this same discussion with them, too.
    As Owainnorth (and many others) observe, it's completely doable.  My only challenge to it (and it's a challenge I state in an unduly heavy-handed fashion sometimes!) is the nonsensical rationales people use for doing it: making it more like XML, it's good if the CFML blends in better with the XHTML mark-up it's generating, it's tidier, etc.
    I hasten to add that Owainnorth's position that he finds it easier to read and assists with code navigation, whilst leaving me with a blank look on my face, is a completely reasonable basis for doing it.  I personally don't believe it, but there's no reason why that should bother him (and I'm sure it doesn't).
    I think it was reasonable of me to challenge his wording that it's easier to identify where CF code blocks are by looking at the closing slash rather than the tag name; but having explained himself better, I reckon it's not quite so much tosh as it originally sounded.  I mean: I still can't see it, but obviously he can, so fair enough.
    Adam

  • Want to include ?xml tag and  schema when creating XML

    My database table that need to be generated in to XML are large and therefore I must use OracleXMLQuery.getXMLSAX . The output is missing the <?xml version="1.0" ?> tag. How do I get it? I am on 9i but have imported the .jar containing oracle/xml/parser/v2/XMLSAXSerializer from 10g XDK.
    Also, I want the schema to be written next, before the actual XML table values.
    I know that a command line parameter exists, which works for small XML files:
    java oraclexml getxml -user "scott/tiger" -withDTD "select ....
    How do I get the equivalent of '"-withDTD" when using
         OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from "+table_name );
         qry.getXMLSAX(myStream);
         myStream.flush();
    Thank you,
    Elaine

    No. Actually, I can get the <?xml tag and DTD if my select statement contains 'where rownum=0', as the resultset is small which lets me use getXMLMetaData() .
    I write it to one output file, then do another OracleXMLQuery, repeating the select statement without the where clause, and run that through getXMLSAX to get the detail.
    Next, I need to scrub the data of special characters acceptable in the database but which cause problems to a browser or XML validator. (e.g. accented characters).
    Finally, I will concatente the two files.
    Is there a simpler way to do this?
    Thanks,
    Elaine

  • The find function (Ctl+F) , doesn't not expanding the xml file , to search for given search. If the the xml file is expanded , then find function finds the tag and data. How to fix this.

    The find function doesn't expanding the xml nodes to search. If the xml is expanded , then find function highlights both matching tag and data. how to fix this.
    == This happened ==
    Every time Firefox opened

    <xsl:value-of select="x"/> produces a string that consists of all text nodes in x.
    <xsl:copy-of select="x"/> produces an exact copy of x.
    Go to http://www.zvon.org/ for more information like this.

  • Changing data in XML variable and appending tags in XML  document

    Hi all,
    I am new to weblogic Integrator . can any one help me concerning following problem
    1. I get input XML message to my workflow which I stores in XML variable. after
    some processing i want to change value of one tag in XML stored in XML variable.
    How I can do thaat ?
    2. I have some XML like
    <root>
    <child>
    <a> </A>
    </child>
    <child>
    </child>
    </root>
    and i want to append multiple such tag at run time . how i can do the same
    in wli
    Please let me know your suggestion
    Kiran

    For both cases I suggest you use XSLT.
    Mike
    "Kiran" <[email protected]> wrote in message
    news:3c720cd2$[email protected]..
    >
    Hi all,
    I am new to weblogic Integrator . can any one help me concerning followingproblem
    1. I get input XML message to my workflow which I stores in XML variable.after
    some processing i want to change value of one tag in XML stored in XMLvariable.
    How I can do thaat ?
    2. I have some XML like
    <root>
    <child>
    <a> </A>
    </child>
    <child>
    </child>
    </root>
    and i want to append multiple such tag at run time . how i can do thesame
    in wli
    Please let me know your suggestion
    Kiran

  • Getting Tag and value from the selected Xml element value

    Hi All,
    I have an xml file which i import to the Indesign CS3 .From the structure view , i drag and drop the root node on to the page. Now i select an xml value from the page. Now i need to get the element tag and value from the selected value.
    For example
    File Name : sample1.xml
    <Root>
    <employeeName> A</employeeName>
    <employeeEmail>[email protected]</employeeEmail>
    </Root>
    Now i import this sample.xml in my indesign CS3 and from the structure view i drag the Root  tag and drop it on the page.Now the values of the element tag are displayed.
    Now i select "[email protected]" from the page and i have a menu "Get Selected XML" on clicking which  i should get element tag with value.(i.e <employeeEmail>[email protected]</employeeEmail>)
    How to go about it.?
    Thanks
    Sakthi

    Hi Steve,
    If you haven't already done so, I recommend posting this question in the LivCycle Forms forum.
    Jared

  • How remove an XML tag and its childs?

    Hi all,
    I'm a newbie with XML library. I would like to remove a specific tag and all its childs from an XML document.
    I've modified an example VI  but Error -2607 is generated (see attachment).
    Thanks in advance
    Attachments:
    xmlTest.jpg ‏167 KB

    Post your code and not a picture about it.

  • HTML embeded in Flash and img tag

    I'm currently developing an application in flash, which
    consist of a hand-drawn screen, in which HTML page appears. To
    achieve this I used a TextField with html option. Unfortunately,
    TextFiles show only some simple tags – is there any other way
    to show more complicated ones in Flash CS3 (and AS3)? I have also a
    problem with the <img> tag. Picture loaded via <img>
    doesn’t print from TextField. My printing code attached -
    webpage_txt is control to print. Do you konw why it doesn't print?
    Thanks in advance for help.

    Currently, no, there are only simple HTML tags available.
    Though, FlashPlayer10 promises to have much greater support for
    text, including inline tables, etc.. You may just have to make do
    with what you have for now, and wait for the new player.
    As for your picture woes, I unfortunately am unable to help
    you there, with very little printJob experience myself.

  • RH9 and XML output - passing build tags

    Hi,
    I've just upgraded to RH9 and have found out that the XML output options are different from RH7 - the RH7 Export Handler "Export Topics to XHTML"  has  disappeared and the other options no longer allow you to retain conditional build tags in the XML output. Instead, the tag is removed (if tag is to be included in compile), leaving the content as is, or the tag and content is removed (if tag excluded).
    As some background, we used the RH7 Export Handler "Export Topics to XHTML" option to strip down the size of our localized content - included tags stay in the XML,exclude tags actually remove content. The XML is reimported into a translatable project where the retained tags (e.g., UserGuide or Help) are used to restrict content to Help or generated User Guide after translation.
    Has anyone any experience of this area of RH9? Woulld you know if this is a bug or by design, or if a workaround is possible? Are there other ways of cutting down projects for translation while having build tag control in your localized versions?
    This breaks my solution for cutting down UK/US help content big time - this has saved a lot on localization costs!
    Many thanks
    Andy Capstick
    [email protected]

    Hi, you can FOR XML PATH for a finer degree of control over your XML.  Use the @ symbol to create attributes.  Here's a simple example:
    DECLARE @t TABLE ( rowId INT IDENTITY PRIMARY KEY, [address] VARCHAR(50), city VARCHAR(30), floor INT, suite INT, doorType VARCHAR(20) )
    INSERT INTO @t VALUES
    ( '123 Fake St', 'Springfield', 10, 512, 'Metal' )
    SELECT
    [address] AS "Address",
    city AS City,
    [floor] AS "Location/@Floor",
    suite AS "Location/@Suite",
    doorType AS "Location/@DoorType"
    FROM @t
    FOR XML PATH ('Company'), ROOT ('Companies'), ELEMENTS;

  • Create XML docs with hierarchy of tags and attr defined in databaste tables

    Hi,
    My problem is a little unique one. I want the ability to define the structure of the XML document (i.e. the hierarchy of element tags and attribute names) in the database tables. The values of tags and attributes will also be populated at runtime in tables.
    Then write some generic API that reads the structure of the XML document through the database tables and spits out an XML document based on this structure and values stored in the tables.
    So, basically, I want the tag names and values both to be values in the database rather than the tag names being the columns in database tables.
    With this I should be able to have one procedure/function that can serve the purpose of creating XML documents with different structures by just specifying that structure in the form of database tables.
    Almost all the Oracle XML utilities I read about, create XML docs based on a SQL query with tag names being columns in the database tables. Any help will be highly appreciated.
    Thanks,
    Monika

    Which database release are you using...
    The computed constructors feature of XQuery may help.
    -Mark

  • Mx:HTTPService tag and mx:headers tag question??

    I am trying to send some header information to my servlet via
    HTTPService.
    I have a <mx:HTTPService> tag and I see that I can have
    child tags to pass header information in the request,
    <mx:headers> But I am not sure of the syntax, I get parse
    errors in the Flex Builder editor. Here is what I have:
    <mx:HTTPService id="Test" method="POST" resultFormat="e4x"
    contentType="application/xml" url="myServlet" useProxy="false">
    <mx:headers>
    <!-- NOT SURE OF THE SYNTAX FOR THE DATA I WANT TO SEND
    HERE????? ->
    </mx:headers>
    </mx:HTTPService>
    Does someone have an example of the <mx:headers>
    section??? I want to pass a value or 2 to my servlet.
    Thanks!

    You can try building the request object in AS instead of
    declaratively
    private var getData():void {
    var oRequest:Object = {};
    oRequest["ui.action"] = ""run";
    oRequest["ui.object"] = "whatever";
    http_srv.send(oRequest)'
    Tracy

Maybe you are looking for

  • Batch Report in Bi Publisher

    we have a requirement like below. i have a report consists of 7 layouts in one rtf it is the information of member . We are trying to run it for batch like 20 members as soon as the output 7 layouts in the rtf are printed for the first member it shou

  • Probably a stupid question but here goes....

    Hello all, Interested in Airport Time Capsule for backing up my iMac and MacBook and MacBook Pro. Can this product replace the current wireless router? As in I currently have an orange livebox for my broadband and can I get rid of this and use this a

  • T400 Backlight Not Working

    I got a Lenovo T400 and the backlight stopped working (LED). Anyone have any ideas?

  • Windows 2008 Cluster question on using a new cluster drive source from shrinking existing disk

    I have a two node Windows 2008 R2 enterprise SP1 cluster. It has a basic cluster setup of one (Q:)quorum disk and data disk (E:) which is 2.7tb is size. This cluster is connected to a shared Dell Disk array. My question is can I safely shrink the 2.7

  • #'s in jsp:forward

    Hi there, Here's what I got: 1. a form to input data. 2. the data is submited to a processing jsp 3. the processing jsp forwards to anohter page. here's my forwarding syntax: <jsp:forward page="PicView.jsp"> <jsp:param name="photoID" value="8987"/> <