Style in XML attribute

Mar 29, 2010 4:22 AM
Hi
I am working with XML Project in indesign CS3. In my document have the following xml elements
<emphasis style="italic">Italic text</emphasis>
<emphasis style="bold">bold text</emphasis>
<emphasis style="bold-italic">Bold Italic text</emphasis>
<emphasis style="sup">Superscript text</emphasis>
<emphasis style="sub">Subscript text</emphasis>
I have a same element name but distinguish with attribute, i need to control styles with this attribute.
Can you please help me, how to control style with XML attributes.
Thanks in Advance
Rajasekar

You need to add the InDesign namespace in each tag to apply different character styles based on the formatting.

Similar Messages

  • XML attribute Undefined?!?

    Hey Flashers!!
    I need some help on the following:
    I am on AS2.0, CS4:
    i am trying to extract the following data from the XML attribute:
    <?xml version="1.0" encoding="utf-8"?>
    <mytext>
    < text ida="Hello world!" idb= "bye World!">
    </mytext>
    Here's my AS2.0 code, i tried to load the xml attributes into the two separate dinamic text fields:
    //load css
    var styles:TextField.StyleSheet = new TextField.StyleSheet();
    styles.setStyle("a:link",{textDecoration:'underline'});
    styles.setStyle("a:hover",{color:'#FF0000'});
    _parent.home_text.styleSheet = styles;
    //load in XML
    var meuXML:XML = new XML();
    meuXML.load("xml/content.php");
    meuXML.ignoreWhite = true;
    meuXML.onLoad = function() {
    _parent.home_text.htmlText = this.childNode[0].childNodes[0].attributes.ida;
    _parent.contacts_text.htmlText = this.childNodes[0],childNode[0].attributes.idb;
    I keep getting an Undefined error...
    Anyone??
    Thanks!!
    Cheers!

    Is this correct? i can't get it work anyway...
    <?xml version="1.0" encoding="utf-8"?>
    <mytext>
    <text ida="Hello world!" idb= "bye World!"></text>
    </mytext>
    AS2.0 code:
    //load css
    var styles:TextField.StyleSheet = new TextField.StyleSheet();
    styles.setStyle("a:link",{textDecoration:'underline'});
    styles.setStyle("a:hover",{color:'#FF0000'});
    _parent.home_text.styleSheet = styles;
    //load in XML
    var meuXML:XML = new XML();
    meuXML.load("xml/content.php");
    meuXML.ignoreWhite = true;
    meuXML.onLoad = function() {
    _parent.home_text.htmlText = this.childNodes[0].childNodes[0].attributes.ida;
    _parent.contacts_text.htmlText = this.childNodes[0],childNodes[0].attributes.idb;

  • Asign paragraph styles to xml nodes

    Hello all,
    I try to asign paragraph styles to xml nodes. I tried to autoasign the styles to tags and also to assign the styles directly to the xml tags with aid:pstyle. None of it with success. I think that this happens because there is a paragraph formating missing in my xml. I tried to change this with <aid:br/> but also no success.
    This is how my xsl looks like:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
      <xsl:output method = "xml" version="1.0" encoding="UTF-8" indent="yes"/>
      <xsl:strip-space elements="*"/>
      <xsl:template match="ooo_sheet">
        <Root>
          <xsl:for-each select="ooo_row">
              <Artikel>
              <xsl:copy-of select="Artikelnummer"/>
                  <Bild>
                        <xsl:attribute name="href">
                      <xsl:text>file:///</xsl:text>
                      <xsl:value-of select="Bildpfad"/>
                        </xsl:attribute>
                  </Bild>
                  <Text xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
                        <EK aid5:pstyle="EK"><xsl:value-of select="EK"/><aid:br/></EK>
                    <Details aid5:pstyle="Details"><xsl:value-of select="Details"/><aid:br/></Details>
                    <Abmessungen aid5:pstyle="Abmessungen"><xsl:value-of select="Abmessungen"/><aid:br/></Abmessungen>
                    <Artikelnummer aid5:pstyle="Artikelnummer"><xsl:value-of select="Artikelnummer"/><aid:br/></Artikelnummer>
                  </Text>
              </Artikel>
          </xsl:for-each>
        </Root>
      </xsl:template>
    </xsl:stylesheet>
    I want to achieve that I can pull the the following tag from the structure view in Indesign to a textframe and the text gets the different formating.
    <Text xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
                        <EK aid5:pstyle="EK"><xsl:value-of select="EK"/><aid:br/></EK>
                    <Details aid5:pstyle="Details"><xsl:value-of select="Details"/><aid:br/></Details>
                    <Abmessungen aid5:pstyle="Abmessungen"><xsl:value-of select="Abmessungen"/><aid:br/></Abmessungen>
                    <Artikelnummer aid5:pstyle="Artikelnummer"><xsl:value-of select="Artikelnummer"/><aid:br/></Artikelnummer>
    </Text>
    Could anyone point me to the right direction? Any help is very welcome. Thank you for your help.

    Sorry, my last example was the xsl instead of the xml. Here is the xml I got. I want to pull the Root/Artikel/Text Tag to a frame and all Child tags within should be formated with the corresponding pstyles.
    But it looks like as if Indesign just does not tranform the aid5 style upon xml/xlst import. The <aid:br> tags you see are just a try of myself to get the tags within the Text tag separated as paragraph.
    But Indesign just interprets them as normal tags and also shows them in the structure pane.
    Thank you very much for your help. I also tried to format the text with the paragraph styles by hand and export the whole thing as xml from Indesign. But Indesign just the xml the same way I imported it. The same happens when I manually create a xml structure in Indesign, assign the styles to the text within the frame. Indesign just exports the raw xml structure. But no style declarations. So I can't see how to format the tags the right way.
    This is how my xml looks like when I import it with the upper xsl.
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Root>
        <Artikel>
            <Artikelnummer>C12-34567</Artikelnummer>
            <Bild href="file:///Users/Diamondgroup/Desktop/KatalogBeispiel/cmyk/C12-34567.PSD"></Bild>
            <Text xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
                <EK aid5:pstyle="EK">1234,-<aid:br></aid:br></EK>
                <Details aid5:pstyle="Details">AAA AAA AAA AAA<aid:br></aid:br></Details>
                <Abmessungen aid5:pstyle="Abmessungen"><aid:br></aid:br></Abmessungen>
                <Artikelnummer aid5:pstyle="Artikelnummer">C12-34567<aid:br></aid:br></Artikelnummer>
            </Text>
        </Artikel>
        <Artikel>
            <Artikelnummer>C23-45678</Artikelnummer>
            <Bild href="file:///Users/Diamondgroup/Desktop/KatalogBeispiel/cmyk/C23-45678.PSD"></Bild>
            <Text xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
                <EK aid5:pstyle="EK">2345,-<aid:br></aid:br></EK>
                <Details aid5:pstyle="Details">BBB BBB BBB BBB<aid:br></aid:br></Details>
                <Abmessungen aid5:pstyle="Abmessungen"><aid:br></aid:br></Abmessungen>
                <Artikelnummer aid5:pstyle="Artikelnummer">C23-45678<aid:br></aid:br></Artikelnummer>
            </Text>
         </Artikel>
    </Root>
    All the xsl: transformations work but the aid: and aid5: transformations just show in the xml as they where in the xsl.

  • CFCHART xml attributes

    I have CFMX7 and I've linked my cfchart to a custom xml
    style:
    <cfchart
    format="flash"
    style="jio_bar">
    But other than adding
    placement="right" to the <legend isVisible="false"
    showColumnLegend="true"> tag, I have not been able to find a
    difinitive list of xml attributes (along wtih their possible
    values) to use for customizing my xml charting style. I've looked
    in the LiveDocs, and I could find all the attributes for the CF
    tags (CFCHART, CFCHARTSERIES, etc.) which is helpful, but I really
    want a very customized look as much as possible. WebCharts3D
    doesn't add much to the CFCHART capabilites either, so I really
    need to find the available parameters for the xml style file.
    Thanks,
    Jonathan

    Thanks for the reply. When I was referring to the WebCharts3D
    app, I only read about it, and based on the list of attributes on
    the LiveDoc, it didn't seem to have anything more than what CFCHART
    offered. I doubleclicked on the webcharts.bat, which is on a
    network drive, and it only opened a CMD window and then closed, and
    I'm not able to see the actual app. :( Is there another way to
    download the utility locally to my machine to use it?

  • Getting at a top-level XML attribute

    It's Friday afternoon... I'm fried and can't seem to figure
    out how to get at a top-level XML attribute.
    Some specifics...
    My XML doc has a single attribute in the top node followed by
    several "version" nodes
    <projData projectName="Spry Project">
    <version>
    I successfully load and create an xml data set from said XML
    file. Later on, I use the getDocument() method to refer to the XML
    DOM doc used by the original xml data set. I need to extract the
    value of the attribute "projectName" into a javascript variable.
    The xpath query should be "projData/@projectName" but all I
    get returned is an undefined value.
    Any ideas? I'm sure it's something simple that I'm
    overlooking.

    > can you please helo.
    This is impossible.
    Obviously your ABAP mapping is wrong. Fix it.

  • File-Adapter: Variable substitution form payload XML-attribute

    Hi experts,
    is possible to use XML-attribute-content for variable substitution in file-Adapter?
    extract from XML:
    <?xml version="1.0" encoding="utf-8" ?>
    - <all>
    - <transaction <b>file="filename"</b>>
    - <table name="BPAADDRESS" options="insertIfUpdateFails">
    - <record id="1">
      <hkeycol name="BPAMAINHKEY">0010500345</hkeycol>
      <hkeycol name="USAGE">Invoice</hkeycol>
      </transaction>
    I want to get the value "filename" = attribute file of transaction.
    Is this possible?
    Thanks a lot,
    Florian

    I have done this taking a field from the XML.
    You have to map the location of the field within the XML...
    Taken from:
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    Variable Substitution (Target Directory/File Name Scheme)
    If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
    &#9679;      Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
    The variables can refer to attributes of the message header or elements of the message payload.
    &#9675;       If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
    sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
    message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
    message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
    For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
    If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
    &#9675;       If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
    namea,nameb,... corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
    The description begins at the root of the document and ends at the respective element.
    To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
    The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (“Example Value”) is set as the value for a specified variable.
    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
      <dummy>
         <e1>
            <e2>Data_1</e2>
            <f/>
            <g attr="abc">text</g>
            <e2>Data_2</e2>
         </e1>
      </dummy>
      <e1>
         <e2>illegal/value</e2>
         <f/>
         <g attr="abc">text</g>
         <e2 attr="fghij">Example Value</e2>
      </e1>
    </root>
    &#9679;      To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.
    Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters “/“, “\“, and “..“.

  • Process XML attributes of all tables in a structured document

    Hi all,
    I try to process the XML attributes of all tables in a structured document.
    When I use SelectedTbl everything works fine for the selected table and the attributes of the tabelle Element are written correctly to the Console.
    doc = app.ActiveDoc;
    table = doc.SelectedTbl;
    if (table.TblElement)
        Console('Elementname: ' + table.TblElement.ElementDef.Name);
        tblEle = table.Element;
        attrs = tblEle.GetAttributes();
        for (i = 0; i < attrs.len; i++) {
            aName = attrs[i].name;
            aWert = attrs[i].values;
            Console( "     " + aName + "    " + aWert);     
    However when I use GetText(Constants.FTI_TblAnchor) to walk through all tables of the documens neither ElementDef.Name nor Attributes are processed.
    var flow = doc.FirstFlowInDoc;
    var textItems = flow.GetText(Constants.FTI_TblAnchor);
    while(iTab<textItems.length) {
    table = textItems[iTab].obj;
    if (table.TblElement)
        Console('Elementname: ' + table.TblElement.ElementDef.Name);
        tblEle = table.Element;
        attrs = tblEle.GetAttributes();
        for (i = 0; i < attrs.len; i++) {
            aName = attrs[i].name;
            aWert = attrs[i].values;
            Console( "     " + aName + "    " + aWert);     
    Any Suggestions?
    Yours
    Wolfgang

    You'll probably want all the tables from the main flow. Try
    var flow = doc.MainFlowInDoc;
    Kind regards
    JoH

  • XML attributes as a response

    My skills are rudimentary, I'm a new flex developer. I have
    done all of the tutorials and examples and I'm just struggling with
    using an XML attribute checking a response.
    I've written a simple flex 3 app to talk to Asterisk AJAM.
    I'm writing the login piece-- and i'm having trouble parsing this
    response from an http service (successful login) my problem comes
    in with the value not being as such
    <item>valuehere</item> it's part of the tag, an
    attribute i would suppose.:
    <ajax-response>
    <response type="object" id="unknown">
    <generic response="Success" message="Authentication
    accepted"/>
    </response>
    </ajax-response>
    What I have is a simple app with a http service and a login
    form. I have an event handler for the HTTP service, but I don't
    know how to parse for that generic response tag. Anyone know how to
    format an XML object for that type of response and throw a simple
    if statement looking for that attribute?
    Failure looks like this BTW:
    <ajax-response>

    <response type="object" id="unknown">
    <generic response="Error" message="Authentication
    failed"/>
    </response>
    </ajax-response>
    Thank you,
    Brian

    I've came up with the following code trying to use XML
    attributes from the response above--- it doesn't work but here is
    what I have (right now the if statement is commented out.... i'm
    trying to have it do an alert which doesn't work either):
    ---source---
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:states>
    <mx:State name="Logged In">
    <mx:SetProperty target="{panel1}" name="width"
    value="95%"/>
    <mx:SetProperty target="{panel1}" name="height"
    value="95%"/>
    <mx:RemoveChild target="{password}"/>
    <mx:RemoveChild target="{username}"/>
    <mx:RemoveChild target="{label1}"/>
    <mx:RemoveChild target="{Submit}"/>
    <mx:RemoveChild target="{label2}"/>
    <mx:SetProperty target="{panel1}" name="title"
    value="Once Logged In"/>
    <mx:AddChild relativeTo="{panel1}"
    position="lastChild">
    <mx:Label x="10" y="10" text="You properly
    authentictaed!"/>
    </mx:AddChild>
    <mx:AddChild relativeTo="{panel1}"
    position="lastChild">
    <mx:Label x="10" y="62" text="Label"/>
    </mx:AddChild>
    </mx:State>
    </mx:states>
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    var MyXML:XML;
    private function checkLogin(evt:ResultEvent):void
    MyXML = evt.result.channel.item;
    mx.controls.Alert.show(MyXML.@*);
    trace(MyXML.@*.toXMLString());
    /* if (MyXML.attribute(ajax-response.response.@generic) ==
    "Success") {
    if (MyXML.ajax-response.response.(@generic == "Success"))
    currentState = "Logged In";
    if (MyXML.ajax-response.response.(@generic == "Error"))
    mx.controls.Alert.show('Invalid username/password');
    ]]>
    </mx:Script>
    <mx:HTTPService id="login_user"
    result="checkLogin(event)" showBusyCursor="true" method="GET" url="
    http://72.22.224.90:8088/asterisk/mxml"
    useProxy="false">
    <mx:request xmlns="">
    <action>login</action>
    <username>
    {username.text}
    </username>
    <password>
    {password.text}
    </password>
    </mx:request>
    </mx:HTTPService>
    <mx:Panel resizeEffect="Resize" width="250" height="200"
    layout="absolute" title="Login System" horizontalCenter="0"
    verticalCenter="-2" id="panel1">
    <mx:Label x="10" y="10" text="Username:" id="label1"/>
    <mx:TextInput x="10" y="36" id="username"/>
    <mx:Label x="10" y="66" text="Password:" id="label2"/>
    <mx:TextInput x="10" y="92" id="password"
    displayAsPassword="true"/>
    <mx:Button x="10" y="122" label="Submit" id="Submit"
    click="login_user.send();"/>
    </mx:Panel>
    </mx:Application>

  • XML attributes instead of elements in data contract serialisation in Rest WCF implementation

    I want to uses XML attributes instead of elements, I implemented IXmlSerializable and
    public partial class Id : IXmlSerializable {
    /// <remarks/>
    [XmlAttribute]
    public string lmsId;
    /// <remarks/>
    [XmlAttribute]
    public string unitId;
    /// <remarks/>
    [XmlAttribute]
    public string lmsPresId;
    /// <remarks/>
    [XmlAttribute]
    public string callId;
    public System.Xml.Schema.XmlSchema GetSchema()
    return null;
    public void ReadXml(System.Xml.XmlReader reader)
    //implement if remote callers are going to pass your object in
    public void WriteXml(System.Xml.XmlWriter writer)
    writer.WriteAttributeString("lmsId", lmsId.ToString());
    writer.WriteAttributeString("unitId", unitId.ToString());
    writer.WriteAttributeString("lmsPresId", lmsPresId.ToString());
    writer.WriteAttributeString("callId", callId.ToString());
    But my service help is showing request and response as unknown
    I tried even XmlSerializerFormat public partial class Id : IXmlSerializable {
    /// <remarks/>
    [XmlAttribute]
    public string lmsId;
    /// <remarks/>
    [XmlAttribute]
    public string unitId;
    /// <remarks/>
    [XmlAttribute]
    public string lmsPresId;
    /// <remarks/>
    [XmlAttribute]
    public string callId;
    public System.Xml.Schema.XmlSchema GetSchema()
    return null;
    public void ReadXml(System.Xml.XmlReader reader)
    //implement if remote callers are going to pass your object in
    public void WriteXml(System.Xml.XmlWriter writer)
    writer.WriteAttributeString("lmsId", lmsId.ToString());
    writer.WriteAttributeString("unitId", unitId.ToString());
    writer.WriteAttributeString("lmsPresId", lmsPresId.ToString());
    writer.WriteAttributeString("callId", callId.ToString());
    then I am getting everything in the xml as xmlElements instead of XmlAttributes But I am getting all the data as elements instead of Xmlattributes

    I will test it.
    I sale myself ONLY half CNY!

  • Maximum size of an XML attribute?

    What is the maximum size of an XML attribute?
    I can't find this define in the OMG XML specification. Does the Oracle XML parser have a maximum size of an XML attribute? Do other XML parsers on the market have any limitation? ... we need to exchange XML documents with other vendors. Thanks.

    While I can't speak for other parsers, the Oracle ones do not have an attribute size limit.
    Oracle XML Team
    null

  • Using BPEL console testing with XML attributes

    I'm having trouble with using an XML attribute in my BPEL process. When I put an attribute on my input element, the BPEL Console test page no longer works. Here's what I'm doing:
    I create a synchronous new BPEL project in JDeveloper using the default input and output XSDs, and add a simple assign to assign the input to the output. When I deploy this and look at it in BPEL console, I can see the input field and enter my value to test.
    Now I go back into JDeveloper and add an attribute to the input element, and then redeploy my process. Now when I go into BPEL console, the Initiate tab no longer has any field for me to enter my value. Clicking the XML Source radio button doesn't help either. (I also tried invoking the BPEL process web service through the app server control - same issue.)
    I'm using JDeveloper 10.1.3.3 with App Server 10.1.3.3.0. Does anyone know how to make the BPEL Console testing work with XSDs that contain attributes?
    Thanks,
    Skip

    A bit more info on this. It doesn't appear that the problem is limited to the console tester. I created another BPEL process which calls my original process, and attempted to set the attribute on the input using the Assign activity. JDeveloper generated this:
    <assign name="Assign_1">
    <copy>
    <from variable="inputVariable" part="payload"
    query="/client:TestAttributes2ProcessRequest/client:input"/>
    <to variable="Invoke_1_process_InputVariable" part="payload"
    query="/ns1:TestAttributesProcessRequest/ns1:input"/>
    </copy>
    <copy>
    <from expression="'bob'"/>
    <to variable="Invoke_1_process_InputVariable" part="payload"
    query="/ns1:TestAttributesProcessRequest/ns1:input/@attribute1"/>
    </copy>
    </assign>
    As you can see this is mapping a variable into the /TestAttributesProcessRequest/input element and then attempting to set the attribute of that element to the value 'bob'. This compiles just fine but when this code is executed, this error occurs:
    Error in <assign> expression: <to> value is empty at line "87". The XPath expression : "" returns zero node, when applied to document shown below:
    oracle.xml.parser.v2.XMLElement@7efe7efe
    (Line 87 is query="/ns1:TestAttributesProcessRequest/ns1:input/@attribute1"/>)
    Is there something wrong with this generated code? Do I need to do some kind of custom code to set attributes, instead of using the graphical tools in JDeveloper?

  • Database control does not map to an XML attribute

    Hi
    Im trying to execute a stored procedure that would return me an XMLBean. During this process, the database control returns me an XMLBean, but doesnt map the XML attributes if any contained in the XSD. All data is mapped to the elements only. Kindly let me if anyone knows how to resolve this to map to the attributes.
    Thanks
    Kishore

    Hi
    Im trying to execute a stored procedure that would return me an XMLBean. During this process, the database control returns me an XMLBean, but doesnt map the XML attributes if any contained in the XSD. All data is mapped to the elements only. Kindly let me if anyone knows how to resolve this to map to the attributes.
    Thanks
    Kishore

  • Indesign library drag drop looses xml attributes of Table tag

    Hi all,
         I have created a Table with 1 row and 3 coloumns, I have text in all 3 cells. I have attaced xml tags to cell text and after that I have added attibutes to Story tag, Table tag and Text tag.  I have drag this table frame to Indesign library to save it for further use.
         When I tried to drag it back to document the Table tag attributes are missing. This is happening on Indesign CS4 Win and Mac.
    I have saved required information in the xml attributes of table tag and since its attributes are missing after drag from library I am not able to use library of Indesign.
    Is this an issue with Indesign CS4?
    -Rahul Dalvi.

    Hi All,
         I am still waitng for the reply. I have attached 2 files here, first one is the Indesign document 'TableXMLTags.indd' having a tagged table. second one is the Library file 'TableXMLtagLibrary.indl' in which I have draged table from 'TableXMLTags.indd'. When I tried to drag that table from library to any document it just loses attributes of Table tag. Here each tag has 3 attributes attached to it.
    I am using Indesign CS4 on Windows and Macintosh.
    Please let me know if there is any way to avoid tag attribute loss.
    Thanks,
    Rahul Dalvi.

  • Storing XML attribute

    I'm trying to store an XML attribute into a variable but the value of the variable is always null. I'm using the SAX parser and displaying the attribute is no problem.
    Here is the content of my xml file:
    <config>
      <param name="saTerminalId" value="63"/>
    <config>And here is the code snippet that I have:
    public class XMLReader extends DefaultHandler{
    public String termnumber;
       public void startElement(String namespaceURI,
                String sName, String qName, Attributes attrs) throws SAXException
             if (attrs.getQName(0) != null) {
                  if (attrs.getQName(0).equals("name") && attrs.getValue(0).equals("saTerminalId")) {
                       this.termnumber = attrs.getValue(1);
                       System.out.println("termn: " + this.termnumber);
    ...Whenever I try to use the termnumber variable, I get null. But if I use the variable inside the startElement, I get the correct value. Any ideas what the problem can be?

    Have you tried:
    this.termnumber = attrs.getValue("value");
    System.out.println("termn: " + this.termnumber);
    Also, your code is risky because there is no requirement that the sequence of items in the Attributes list is the same as the sequence of the way the attributes are coded. It may even vary from parser to parser.
    Dave Patterson

  • A bug in XML::attributes()

    In the past, if you run these:
    var xml:XML = <xml a="1" b="2"/>
    var a:XML = xml.attributes()[0];
    trace(a.toXMLString());
    you'll get a right callback like:
    <a>1</a>
    But if you run the same in the latest version,
    you'll get a callback like:
    1
    The xml objects in the xmlist returned from attributes() is
    unexpected in the latest version.
    for another example:
    In early version:
    var xml:XML = <xml a="1" b="2"/>
    var list:XMLList = xml.attributes();
    var xml2:XML = <xml><node/></xml>
    xml2.appendChild(list[0]);
    trace(xml2.toXMLString());
    you will get a right one :
    <xml>
    <node/>
    <a>1</a>
    </xml>
    current version you will get a terrible callback:
    <xml>
    <node/>
    1
    </xml>
    How can I accept with this bug? Please check your SDK and
    runtime Player!!!!
    (excuse for my week English)

    keep in mind that flex 3 should be released in Q4 2007.
    Maybe you should try to work with Flex2.01 or maybe you can
    use multiple SDKs in flex 3 (
    http://flashenabled.wordpress.com/2007/06/19/running-your-flex2-application-in-flexbuilder -3/
    I was also struggling with webservice calls in flex 2 hotfix
    2 and now I went back to Flex 2.01

Maybe you are looking for