Id and name attributes on xsd elements

id, and name attributes on elements do not have a defined length, correct?
We are shredding an xml document into storage, currently we assign 255 characters for the field that will persist the values, since the id/name fields can be longer than this is there a best practice hat is recommended for xml authors not to create ids, and names with a long string.
I am working in a specialization of xml called XBRL,
Neil

Per the W3C standards, as I read them, you are correct. There is no limit on how long the attribute name (http://www.w3.org/TR/2008/REC-xml-20081126/#attdecls) can be. Follow the Name link on that page and you'll see a Name is defined as NameStartChar (NameChar)*, which is unbounded in length.
What various tools, including Oracle implement, for max name lengths is not known to me but your 255 seems more than reasonable. The best practice in terms of node name length depends upon who created the schema and what pattern they followed.
For example, this ISO standard
ISO/IEC 11179-5:2005, Information technology — Metadata registries (MDR) — Part 5: Naming and identification principles. Available from
http://standards.iso.org/ittf/PubliclyAvailableStandards/c035347_ISO_IEC_11179-5_2005(E).zip.
is used by NIEM but neither it nor additional NIEM restrictions put a max length on node names.
I've played around some with XBRL too and while I've seen a few long ones, I don't think they were over 50 characters so 255 would be more than enough. You could play around with all the .xsd schemas they have and look to see what the longest node name is and then set your length just over that but 255 is more than plenty in my opinion.

Similar Messages

  • ID and Name attributes on same element

    Please note that both these elements are the same, but one
    has an "Name"
    attribute in addition to an "ID" attribute
    a) <select id="RES_state" size="1" >
    b) <select name="RES_state" id="RES_state" size="1" >
    In IE, I can use document.getElementById("RES_State") without
    error with
    both a) and b). However, in Firefox I get javascript error
    ("has no
    properties" errror) if I use both attributes with same value
    in Firefox.
    Any ideas here?

    Interesting, I thought not and was going to ask him what he
    meant.
    I suspect it had to do with the use of the the javascript -
    eg;
    document.getElementById("myID")
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:f3l7cf$jo5$[email protected]..
    > There is no case sensitivity issue in the code you
    posted.
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    > ==================
    >
    >
    > "Campag" <[email protected]> wrote in message
    > news:f3l6kg$itd$[email protected]..
    >> thanks guys.
    >>
    >> No - it is a unique id on teh page.
    >>
    >> A devloper fixed it - said it was a case sensetivity
    issue. Yet to look
    >> at where.
    >>
    >> "Gary White" <[email protected]> wrote in
    message
    >> news:[email protected]..
    >>> On Wed, 30 May 2007 15:32:46 +0800, "Campag"
    <[email protected]> wrote:
    >>>
    >>>>Please note that both these elements are the
    same, but one has an "Name"
    >>>>attribute in addition to an "ID" attribute
    >>>>
    >>>>a) <select id="RES_state" size="1" >
    >>>>
    >>>>b) <select name="RES_state" id="RES_state"
    size="1" >
    >>>
    >>> Are these both on the same page? You cannot use
    the same ID more than
    >>> once on a page.
    >>>
    >>> Gary
    >>
    >>
    >
    >

  • Get (variable) file path and name in a text element

    How do you get the (variable) file path and name in a text element (label) in LCD? If you save the PDF and afterwards relocate it, it should update the values. Is that actually possible?

    Does anyone have any advice on this issue?
    Thanks in advance,
    Zack H.

  • Restritions on id and name attributes?

    Are there any known restrictions in respect to what ascii characters are valid for object id and name attribute?
    I created (via xml file) a ObjectGroup (aka Organization) with id='#ID#ObjectGroup:Approve_org' name='Approve_org' displayName='Approve_org'
    The Organiozation did not open and did not show the contained users.
    With this id and name it worked fine.
    id='#ID#ObjectGroup:ApproveOrg' name='ApproveOrg' displayName='Approve_org'
    Any thoughts?
    Ugato

    From my experience, the name and id attribute may contain pretty much every character - at least I have yet to find anything that isn't accepted. I even tried your example "Approve_org" and it worked (in IDM 8.1).
    This is what I uploaded:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE ObjectGroup PUBLIC 'waveset.dtd' 'waveset.dtd'>
    <!--  MemberObjectGroups="#ID#Top" displayName="Approve_Org" name="Approve_Org"-->
    <ObjectGroup
          id='#ID#ObjectGroup#Approve_Org'
          name='Approve_Org'
          displayName='Approve_Org'
          creator='Configurator'
          primaryObjectClass='ObjectGroup'>
      <PathFromTop>
        <List>
          <String>#ID#Top</String>
          <String>#ID#ObjectGroup#Approve_Org</String>
        </List>
      </PathFromTop>
      <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
      </MemberObjectGroups>
    </ObjectGroup>Maybe you had something else wrong?

  • Retrieve Element ID and Name

    I want to get element's id and name attributes from a web page by clicking  on the element using VBA. I have a button in excel sheet and I want if a user clicks on that button, after that whenever user clicks(Right Click) on a element in a webpage, system
    should return its element id(1st priority) through message box. If id is not present then it should return element name(2nd priority). If both Id and Name are not present then code will return some message stating that Id or Name not found. 
    Thanks!!

    Does any have any update on this? Please help..
    Thanks!!
     

  • Schema Validation on attributes of an element in XML againt XSD schema

    Hi,
    I had generated artifact java classes from XSD schema file.Now i am validatiing one sample XML document by using these classes in JAXB.The XML document is validated successfully.but only elements are validated ,but not attributes of that elements.for example ,i am giving wrong element which is not defined inside the schema file,it throws validation error as expected ,whereas validation against wrong attributes of elements in XML it is not working anyway,it does not throw any validation errors,but it should throw validation errors.kindly help me to solve this issue.
    Here The sample validation code snippets :
    import javax.xml.bind.ValidationEvent;
    import javax.xml.bind.ValidationEventHandler;
    import javax.xml.bind.ValidationEventLocator;
    public class MyEventHandler implements ValidationEventHandler{
         public boolean handleEvent(ValidationEvent ve) {
              if (ve.getSeverity()==ValidationEvent.FATAL_ERROR ||
                        ve .getSeverity()==ValidationEvent.ERROR){
                   ValidationEventLocator locator = ve.getLocator();
                   //Print message from valdation event
                   System.out.println("Invalid booking document: "
                             + locator.getURL());
                   System.out.println("Error: " + ve.getMessage());
                   //Output line and column number
                   System.out.println("Error at column " +
                             locator.getColumnNumber() +
                             ", line "
                             + locator.getLineNumber());
              return true;
    Unmarshaller unmarshaller = jc.createUnmarshaller();
    unmarshaller.setEventHandler(new MyEventHandler());

    Here is my analagous 'strange' behavior. I am jaxb processing and then marshalling generated classes to XML ( following the simple Sun 'PurchaseOrder' example )
    1. This works:
    <xsd:schema....>
    <xsd:complextType name = "myName">
    <xsd:attribute name='name1'>
    </xsd:complextType>
    </xsd:schema>
    2. This doesn't:
    <xsd:schema....>
    <xsd:complextType name = "myName">
    <xsd:attribute name='name1'/>
    <xsd:attribute name='name2'/>
    </xsd:complextType>
    </xsd:schema>
    That is, using more than one attribute line within this simple complex type causes nothing to be marshalled to XML.
    Ideas?

  • Xsd:complexType with extension and unordered (sometimes not all) elements

    Hello, I have a schema definition that I need to change.
    I have the following BASE (from which I extend) elements Entity and Record Info, and I have a Quote element that extends from entity.
    Some times a Quote (title, context, quoted, written) will have all its elements and some times the user will not enter the [context] for example (as the quote maybe self explanatory),
    so I am in need of a definition that will allow me that.
    Also I have a User entity that is working fine, but when I run the JUnit test it changes the order of userName and userPassword and what happens is that it throws an error because it is expecting the order (userName then userPassword, and not userPassword firs, and userName second) is this possible to change also?
    The ideal would be a Definition that will allow me unordered elements and some of the elements can be missing also, well now that I think about it I could just put the element with an empty string, but what could I do about the order?
    I need some field like id and record info, but the rest, I really don't care if title is the first element or the last.
    These are my schema parts I used to have sequence but I am trying with xsd:all but it crashes:
        <xsd:complexType name="entity">
            <xsd:sequence>
                <xsd:element name="synapseId" type="xsd:string"></xsd:element>
                <xsd:element name="recordInfo" type="tns:recordInformation" xmlns:tns="http://xml.fdt.com/Schemas/Cognoscere/mainRepository"></xsd:element>
            </xsd:sequence>
            <xsd:attribute name="id" type="xsd:string"/>
            <xsd:attribute name="languageCode" type="xsd:string"/>
            <xsd:attribute name="countryCode" type="xsd:string"/>
            <xsd:attribute name="regenerateAs" type="xsd:string" use="optional"/>
        </xsd:complexType>
        <xsd:complexType name="recordInformation">
            <xsd:sequence>
                <xsd:element name="createdBy" type="xsd:string"></xsd:element>
                <xsd:element name="createdDate" type="xsd:long"></xsd:element>
                <xsd:element name="modifiedBy" type="xsd:string"></xsd:element>
                <xsd:element name="modifiedDate" type="xsd:long"></xsd:element>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="quote">
            <xsd:complexContent>
                <xsd:extension base="tns:entity">
                    <xsd:sequence>
                            <xsd:element name="title" type="xsd:string"></xsd:element>
                            <xsd:element name="context" type="xsd:string"></xsd:element>
                            <xsd:element name="preface" type="xsd:string"></xsd:element>
                            <xsd:element name="quoted" type="xsd:string"></xsd:element>
                            <xsd:element name="written" type="xsd:long"></xsd:element>
                    </xsd:sequence>
                </xsd:extension>
            </xsd:complexContent>
        </xsd:complexType>by the way, when I tried with xsd:all minOccur etc, this is the error it threw:
    s4s-elt-must-match.1: The content of 'sequence' must match (annotation?, (element | group | choice | sequence | any)*). A problem was found starting at: all. [58]
    f(t)

    sorry the error was
    cos-all-limited.1.2: An all model group must appear in a particle with {min occurs} = {max occurs} = 1, and that particle must be part of a pair which constitutes the {content type} of a complex type definition.
    not the other one.
    I found it is working with choice. Is this ok?
    <xsd:complexType name="quote">
            <xsd:complexContent>
                <xsd:extension base="tns:entity">
                    <xsd:choice minOccurs="0" maxOccurs="unbounded">
                        <xsd:element name="title" type="xsd:string"></xsd:element>
                        <xsd:element name="context" type="xsd:string"></xsd:element>
                        <xsd:element name="preface" type="xsd:string"></xsd:element>
                        <xsd:element name="quoted" type="xsd:string"></xsd:element>
                        <xsd:element name="written" type="xsd:long"></xsd:element>
                    </xsd:choice>
                </xsd:extension>
            </xsd:complexContent>
        </xsd:complexType>Doesn't look right to me, but my app is working, I would like to do it well not just have it working. (welcome to the nice happy and easy going place that is my mind) ;-)
    f(t)

  • ID and IDREF attributes in an XSD

    Does anybody know if the ID and IDREF attributes within an XSD schema are implied when inserting an XML document or do I have to invoke an XML parser and do it via a DTD?
    When I test the XSD no validation is being performed on the ID and IDREF attributes. Yet when I use the parser the document raises the required errors.
    Regards
    Andrew
    Schema extra:
    <xs:complexType name="PAYMENT" xdb:SQLType="XML_PAYMENT">
    <xs:sequence>
         <xs:choice>
    <xs:element name="USER_ID" type="xs:integer" nillable="false" xdb:SQLType="NUMBER" />
    <xs:element name="SERVICE_ID" type="xs:integer" nillable="false" xdb:SQLType="NUMBER" />
         </xs:choice>
         <xs:element name="CHARGE" type="CHARGE_TYPE" />
    </xs:sequence>
    <xs:attribute name="PAYMENT_ID" type="xs:ID" use="required" />
    <xs:attribute name="PAYMENT_IDREF" type="xs:IDREF" />
    </xs:complexType>

    Mark,
    I tried this with a valid schema and the function returns zero - false. Yet when I query the table the function says it is valid.
    SQL
    SELECT x.charge_doc.isSchemaValid('http://otn.oracle.com/ServiceCharge.xsd','SERVICE_CHARGE')
    FROM service_charge x;
    returns 1 (valid).
    CREATE OR REPLACE TRIGGER validate_service_charge
    before insert on service_charge
    for each row
    declare
    begin
    if :new.charge_doc.schemavalidated() = 1 then
         dbms_output.put_line('Data is valid');
    else
         dbms_output.put_line('Data is invalid');
    end if;
    end;

  • [JS-CS4] - How to read the XML Element and its Attributes

    Dear All,
      I have the doubt regarding: reading the xmlElement and its attributes.
    Here I droping the xml script
    //============= Start ======================//
    var myDoc = app.activeDocument;
    var Fpath = File("../Projects/Entity_map.xml");
      if (Fpath.exists)
       Fpath.open("r");
       var Cont= Fpath.read();
      var roots = new XML(Cont);
      var myEveryName = new Array();
      var myEveryContent = new Array();
      var myEveryAttributes = new Array();
      traverse(roots);
    //$.writeln(myEveryName);
    //$.writeln(myEveryContent);
    $.writeln(myEveryAttributes.length);
    for(var i=0; i<myEveryAttributes.length; i++)
      $.writeln(myEveryAttributes[i]);
    function traverse(tree) {
        myEveryName.push(tree.name());
    myEveryContent.push(tree.text());
      myEveryAttributes.push(tree.getAttribute);
    // you get the contents by using .text() insted of .name()
        if(tree.elements().length() > 0) {
            for(var i=0; i<tree.elements().length(); i++) {
                traverse(tree.elements()[i]);
    //============== End =====================//
    and the XML Structure is
    //===============XML =====================//
    <?xml version="1.0" encoding="UTF-8"?>< Entity_Convertion>
    < Entitys char="Ç" GID="173"/></ 
    Entity_Convertion>
    //===============End ====================//
    Here I'm getting the XML Elements and its contents, but not xmlAttributes.
    Please any one can help me, then I will appreciate...
    Thanks & Regards
    T.R.Harihara SudhaN

    Dear All,
      I have the doubt regarding: reading the xmlElement and its attributes.
    Here I droping the xml script
    //============= Start ======================//
    var myDoc = app.activeDocument;
    var Fpath = File("../Projects/Entity_map.xml");
      if (Fpath.exists)
       Fpath.open("r");
       var Cont= Fpath.read();
      var roots = new XML(Cont);
      var myEveryName = new Array();
      var myEveryContent = new Array();
      var myEveryAttributes = new Array();
      traverse(roots);
    //$.writeln(myEveryName);
    //$.writeln(myEveryContent);
    $.writeln(myEveryAttributes.length);
    for(var i=0; i<myEveryAttributes.length; i++)
      $.writeln(myEveryAttributes[i]);
    function traverse(tree) {
        myEveryName.push(tree.name());
    myEveryContent.push(tree.text());
      myEveryAttributes.push(tree.getAttribute);
    // you get the contents by using .text() insted of .name()
        if(tree.elements().length() > 0) {
            for(var i=0; i<tree.elements().length(); i++) {
                traverse(tree.elements()[i]);
    //============== End =====================//
    and the XML Structure is
    //===============XML =====================//
    <?xml version="1.0" encoding="UTF-8"?>< Entity_Convertion>
    < Entitys char="Ç" GID="173"/></ 
    Entity_Convertion>
    //===============End ====================//
    Here I'm getting the XML Elements and its contents, but not xmlAttributes.
    Please any one can help me, then I will appreciate...
    Thanks & Regards
    T.R.Harihara SudhaN

  • XPath expression for fetching element names & attributes

    Hi out there!
    I�m trying to get a result set out of a xml schema, using XPath. The problem is, that any expression gets just a whole node set back, as it seems. The result I�d like to get would be the following. Imagine I got a schema like this:
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:r="http://recipes.org"
    targetNamespace="http://recipes.org"
    elementFormDefault="qualified">
    <element name="recipe">
    <complexType>
    <sequence>
    <element name="title" type="string"/>
    <element ref="r:ingredient" minOccurs="0" maxOccurs="unbounded"/>
    <element ref="r:preparation"/>
    <element name="comment" minOccurs="0" type="string"/>
    <element name="nutrition">
    <complexType>
    <attribute name="protein" type="r:nonNegativeDecimal" use="required"/>
    <attribute name="carbohydrates" type="r:nonNegativeDecimal" use="required"/>
    <attribute name="fat" type="r:nonNegativeDecimal" use="required"/>
    <attribute name="calories" type="r:nonNegativeDecimal" use="required"/>
    <attribute name="alcohol" type="r:nonNegativeDecimal" use="optional"/>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    </schema>
    Now, when I`m refering to the element <attribute name="protein" type="r:nonNegativeDecimal" use="required"/>, I would like to get all ancestors of it, which is not a big issue at all, but i`d just like to get their names and attributes, if they have some. So the result should be something like:
    <element name="recipe">
    <complexType>
    <sequence>
    <element name="nutrition">
    <complexType>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    Any ideas anybody?
    Thanks in advance, Jens

    Well, I would use the org.apache.xpath.XPathAPI class and parse the input XML into a DOM document., and then utilize the single xpath expression //attribute[@name=protein]/ancestor::* to recover all ancestors (in a directal-tree-traversal order) of any node called "attribute" and with attr "name=protein" .
    Could it be?

  • File name from an attribute of an element of the payload

    Dear Experts,
    Could you suggest the syntax for specifying the file name from a variable in the file receiver communication channel? I need to grab the file name from an ATTRIBUTE of an element of the payload.
    Thanks a lot.
    Example: Need to pass the attribute "descReceipt" of the element "promotionEvent" to the variable in the following payload:
    <?xml version="1.0" encoding="UTF-8"?>
    <promotionExport>
    <promotionEvent eventIdentifier="30" status="A" descReceipt="FILE1">

    The scenario is IDOC to FILE. I need to get the value of the receiving partner.
    The message header has the node "DynamicConfiguration". Please see the xml below. I need to grab the key RCVPRN (0000002104) from this and pass as the file name in the receiver file adapter.
    How do I setup my receiver file adapter for this? I tried changing the values for the variable, and also enabling the adapter specific message attributes. No solution yet.
    <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="RCVPOR">LXDCLNT250</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="SNDPRT">LS</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="RCVPRN">0000002104</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="SNDPOR">SAPLCD</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="SNDPRN">LCDCLNT220</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="CIMTYP" />
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="IDOCTYP">WPDBBY01</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="MESTYP">WPDBBY</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="RCVPRT">KU</SAP:Record>
      </SAP:DynamicConfiguration>

  • The name attribute on the img element is obsolete. Use the id attribute instead.

    When I valadate my page I get an error "The name attribute on the img element is obsolete. Use the id attribute instead." In DW CS5.5 I cannot seem to enter an ID without DW also adding the ID as a name attribute too. Aside from manually going in and removing the name attribute from the code.

    It won't hurt to leave the name attribute in your <img> tag.  In fact, it may be necessary if you are going to add an image rollover behavior, since DW's javascript relies on that name attribute's value to correctly identify the desired image on the page.

  • Modify Transition element in work flow using for and not attributes to restrict access

    Hi,
    I have TFS 2013 for my premises and I am working on changing the work flow for TFS work item. I have created a work item as per requirement and it has 3 states
    Active, In Review and Closed in work flow. When developer creates a work item it is in Active state and later it is sent to In Review and then to close after successful review.
    My question is I want development team to be restricted to move the work item to Close state. At present when developer creates a new work item they see Active state. At this point they can not see any other states in the work item. Later they
    fill the details and after checkin they will put that work item to In Review state. At this point they can see Active and In Review states. When they save this work item and modify it again they see Close state as well. I want to design the Transition element
    in work flow in such a way then developers should not be able to see the Close state at all in a work item assigned to them. Only reviewer should be able to transit the work item from In Review to Close.
    I checked the for and not attributes in the transition element but I have no idea about correct syntax I should use to enforce the restriction. I would also like to mention here that I have no separate groups defined in my TFS server. Every
    one is a part of contributor's group. There is no specific group of reviewers and one developer reviews the code of another. I want to design the work flow in such a way that the developer who creates (or gets assigned) the work item should
    not be able to put their own work item in Close state but they should be able to close another developer's work item if that work item has his name in the reviewer's box.
    I have tried to simplify my question by elaborating it hope it is not complex to understand. Let me know if you want further clarification on this.
    Regards, Premal Acharya

    Hi Premal,
    For your scenario, seems the "for" and "not" attributes not are unavailable to make it happens. Because of the developers not in groups, and the same type of work items can be assigned to all the developers hence the attributes cannot
    be allow and deny users in the groups concurrently. Please check the
    page for more information about transition xml element.
    Based on your situation, you can separate the development group and test group. Then you can only allow test group to change the state.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Making XSD element name match the column name/header

    The XML format of the answer I created looks like the following. How can I change the element name from C0, C1... to real column name? http://host:port/analytics/saw.dll?Go&searchid provided the XML
    <?xml version="1.0" encoding="utf-8" ?>
    - <RS xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
    - <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:saw-sql="urn:saw-sql" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset">
    - <xsd:complexType name="R">
    - <xsd:sequence>
    <xsd:element name="C0" type="xsd:double" minOccurs="0" maxOccurs="1" saw-sql:type="double" saw-sql:displayFormula=""CUSTOMERS"."SALES"" saw-sql:aggregationRule="none" saw-sql:aggregationType="nonAgg" saw-sql:tableHeading="CUSTOMERS" saw-sql:columnHeading="SALES" />
    <xsd:element name="C1" type="xsd:string" minOccurs="0" maxOccurs="1" saw-sql:type="varchar" saw-sql:displayFormula=""CUSTOMERS"."CITY"" saw-sql:aggregationRule="none" saw-sql:aggregationType="nonAgg" saw-sql:tableHeading="CUSTOMERS" saw-sql:columnHeading="CITY" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    - <R>
    *<C0>0.3</C0>*
    *<C1>WILLITS</C1>*
    </R>
    Edited by: user732932 on Jan 7, 2010 11:38 AM

    OR is there a way to pass the column headers from OBIEE to a URL? For example, session parameters can be passed using @{parmName}

  • LineChart with unknown amount and name of elements

    Hi!
    I want to create a LineChart. This charts displays a changing
    number over a period of time.
    <?xml version="1.0" encoding="utf-8"?>
    <root>
    <poll>
    <id>1</id>
    <answerIDs>
    <id>a1</id>
    <id>a2</id>
    </answerIDs>
    <resultsByDate>
    <entry date="03/01/2007">
    <1><results>15</results></1>
    <2><results>18</results></2>
    </entry>
    <entry date="03/02/2007">
    <1><results>25</results></1>
    <2><results>8</results></2>
    </entry>
    <entry date="03/03/2007">
    <1><results>45</results></1>
    <2><results>38</results></2>
    </entry>
    </resultsByDate>
    </poll>
    </root>
    <mx:LineChart id="chart"
    dataProvider="{service.lastResult.root.poll.resultsByDate.entry}"
    >
    <mx:horizontalAxis>
    <mx:CategoryAxis categoryField="date" />
    </mx:horizontalAxis>
    <mx:horizontalAxisRenderer>
    <mx:AxisRenderer labelRotation="45" />
    </mx:horizontalAxisRenderer>
    <mx:series>
    <mx:LineSeries displayName="1" xField="date"
    yField="results" />
    <mx:LineSeries displayName="2" xField="date"
    yField="results" />
    </mx:series>
    </mx:LineChart>
    It only works when I don't use <results> in the XML and
    set the yField to "1" or "2".
    Later In the application I don't know the amount and name of
    the elements (1,2,44,4564, ..), so I will use AS for that:
    var ls:LineSeries = new LineSeries();
    chart.series = [ls]; // associate the array
    var answers:Array = ["1", "2"];
    for (var i:uint = 0; i < 2; i++)
    trace(i);
    ls = new LineSeries();
    ls.displayName = answers
    .toString()
    ls.xField = 'date';
    ls.yField = 'results';
    chart.series = ls;
    This code works, but only without 'results'.
    Maybe can someone help me? I sit not possible to have nested
    objects as provider for xField and yField?

    By using a temporary table instead of a permanent.SET @query =
    'SELECT * INTO #NewPivotTable
    FROM
    SELECT productId,_year,amount
    FROM Products
    )t
    PIVOT (SUM(amount) FOR _year
    IN ('+@years+')) AS pvt; SELECT * FROM #NewPivotTable '
    EXECUTE (@query)
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • OS X and Windows partitions won't appear

    I created a 60 gig partition for Windows 7 in boot camp a few weeks ago. Today, I decided to erase the Windows partition, split it in two, and install Windows 7 on one and Windows XP on the other. Windows XP installed fine, but now the other partitio

  • Adobe Reader X Intermittent Crashes

    We are experiencing an issue with Adobe Reader X this issue has been occurring through version 10.x-10.x.x  it will randomly crash when any user including an administrator is opening a pdf file from any location be it local or network.  Adobe is inst

  • SMP in Adobe AIR mobile

    Hi,   How do we get SMP (Strobe Media PlayBack) to work in Adobe AIR Mobile project? Ideally there should be a SWC for SMP.... Regards Baliga

  • My elements suite i bought (CD) doesn't have a serial number

    Hi i bought Adobe Premiere elements 13 and Photoshop Elements 13 in a box (CD) from JB hifi and it has no serial number any where that i can see so therefore i cannot install the programmes. thanks Janet

  • Upgrade to CS4 when CS2 disks lost

    I lost my CS2 disks, but Adobe Web Support said I could still purchase the CS4 upgrade instead of the full version because I have the CS2 serial numbers.  The problem is, I'm upgrading to a brand new computer.  In order for the CS4 upgrade software t