Override the name attribute in inputText or inputHidden

Hi all,
Is it possible to override the name attribute of an input element? For example, the following JSF page:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<f:view>
<html>
<body>
<h:form>
  <h:inputText/><br />
  <h:inputHidden /><br />
  <h:inputText id="input1" /><br />
  <h:inputHidden id="input2" /><br />
</h:form>
</body>
</html>
</f:view>Produces the following HTML:
<html>
<body>
<form id="j_id_jsp_188410409_1" name="j_id_jsp_188410409_1" method="post" action="/cbs/test.jsf" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_id_jsp_188410409_1" value="j_id_jsp_188410409_1" />
<input type="text" name="j_id_jsp_188410409_1:j_id_jsp_188410409_2" />
  <br />
  <input type="hidden" name="j_id_jsp_188410409_1:j_id_jsp_188410409_3" /><br />
  <input id="j_id_jsp_188410409_1:input1" type="text" name="j_id_jsp_188410409_1:input1" /><br />
  <input id="j_id_jsp_188410409_1:input2" type="hidden" name="j_id_jsp_188410409_1:input2" /><br />
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="_id2" />
</form>
</body>
</html>Would I have to write a custom component and then override the getName and setName attributes?
Many Thanks
Andy

Note that the HTML you posted does not match the JSF source you posted.
If you just need dependable names, add an id to the <h:form> and then the name will be in the format formId:inputId.
Another possibility is to use the prependId attribute of <h:form> to suppress the name mangling.
Yet another possibility is to use the forceId attribute of the Tomahawk components.

Similar Messages

  • What is the value of the 'Name' attribute of an Instance of Resource Type IPv6 Adress?

    See subject. I'm writing a Powershell script which is supposed to return the configured hostname and IP Address for a service associated with a role on a failover cluster. I'm using, e.g.. the following to retrieve the IPv4 Address:
    $a1 = Get-ClusterResource "MyServiceDisplayName"
    $b1 = Get-ClusterGroup $a1.OwnerGroup.Name | Get-ClusterResource | Where-Object {$_.ResourceType -eq "IP Address"}
    $c1 = Get-ClusterResource $b1.Name | Get-ClusterParameter | Where-Object {$_.Name -eq "Address"}
    and then I access the result via $c1.Value.
    I want to do the same for an IPv6 address. The information I don't have is the 'Name' attribute of the result of the Get-ClusterParameter command, that is the condition of the  Where-Object in the line which gives me $c1. (for the
    IPv4 Address I got it by running this on our test server, but that does not have IPv6 configured, so I cannot do the same in that case). Is it simply 'Address' as well?
    TIA, Thomas

    Hi,
    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
    Thanks for your understanding and support.
    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.

  • 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.

  • How can ftp-adapter override the name rules

    I have a ftp adaptor, which generate filenames with the following rule NA<%time%>.txt, but I would rather have it be stamped with a more meaninful filename ex NA<accountnumber>.txt.
    I am new to Interconnect, IStudio and ftp adaptors...so I have no experience in this. I
    I have done some research, and I realise that I might have to overwrite the The FileSenderCustomizer Interface more specifically the generateFilename method.
    The question is really, where and how do I do this?
    Thanks
    Edited by: olona on Mar 3, 2010 4:54 AM
    Edited by: olona on Mar 5, 2010 4:53 AM
    Move to Integration - Adapters => Integration - Adapters

    An example of a ftp-adapter that will generate a filename based on a value in the file. The file contains CustomerListRecord which again contains multiple Records of Customers, which then contains the actual values.
    import java.util.Date;
    import java.util.ListIterator;
    import java.util.Vector;
    import oracle.oai.agent.adapter.sdk.Agent;
    import oracle.oai.agent.adapter.sdk.AttributeObject;
    import oracle.oai.agent.adapter.sdk.MessageObject;
    import oracle.oai.agent.adapter.transport.TransportMessage;
    public class SlfNaskCustFileSender {
         private final static String objectName = "SLFCustFileSenderStripped";
         private final String fileNameExtension = ".c15";
         private final String keyMasterRecord = "CustomerListRecord";
         private final String keyRecords = "Records";
         private final String keyRecordField = "apar_id";
         public static void main(String args[]) {
              System.out.println("Its alive: " + objectName);
         public String generateFileName(Agent agent, String rule, String app, String partitition, Date time,
                   MessageObject mobj, AttributeObject aobj) {
              // Default filename. Add random element just in case.
              String fileName = "NAC" + (Math.random() * 100) + fileNameExtension;
              // Picking up the buntnumber.
              AttributeObject aoCustListRecords = (AttributeObject) mobj.get(keyMasterRecord);
              Object o = aoCustListRecords.get(keyRecords);
              if (o instanceof Vector) {
                   Vector v = (Vector) o;
                   ListIterator iter = v.listIterator();
                   while (iter.hasNext()) {
                        Object x = iter.next();
                        if (x instanceof AttributeObject) {
                             AttributeObject aoX = (AttributeObject) x;
                             fileName = aoX.get(keyRecordField) + fileNameExtension;
              return fileName;
         public void customizeTransportMessage(Agent agent, TransportMessage transportMessage, MessageObject mobj,
                   AttributeObject aobj) {
    }

  • How to override the default "required" attribute for the UIComponent?

    Hi, consider the following markup: <h:inputText id="txt_firstName" value="#{myBean.firstName}" required="true"/>
    if I leave this field empty and hit the submit button, the required validator will fire an error msg. If however, I leave an empty space in the text box and hit submit button, it will go through no problem.
    I'd like to override the required attribute, so it will trim the spaces first before decide if it really is empty:
    //whatever the name of the method i'm overriding....
    String value = (String)value;
    if(value==null)throw new ValidatorException(whateverDefinedInTheBundle);
    value = value.trim();
    if(value.length==0)throw new ValidatorException(whateverDefinedInTheBundle);
    How can I go about doing that?
    Thank you.

    Did you already try
               <af:treeTable value="#{bindings.DashProjectPhasesDev.treeModel}"
                                  var="node"
                                  selectionListener="#{bindings.DashProjectPhasesDev.treeModel.makeCurrent}"
                                  rowSelection="none" rowBandingInterval="0"
                             inlineStyle="width:810px; height:1100px;"> Check the last line with inlineStyle...
    Julian

  • Name attribute not giving the desired result in form tag

    Hi,
    I am using struts and the name attribute in form tag is not giving me the desired reuslt. The code is
    <html:form name="loginActionForm" type="source.form.LoginActionForm" action="/login.do" method="post">
    </html:form>
    when I am trying to use the name in javascript then I am getting an error
    "document.loginActionForm " is null or not an object.Where am I going wrong?

    I did so but the name I have used in the form tag is the same as what i have used in javascript.I dont think that it is a javascript error and it must be some mistake I made in the form tag.Also one more thing is it necessary to use the type attribute if you use the name attribute.

  • What's the use for "name" attribute?

    Almost every object has a "name" attribute and "display name" attribute, e.g. page, tab, template.
    What is the exact use of the name attribute. For my understanding, one of its use to is contruct a URL for the object. For example, when I want to add one item to a page, the shows me the path to the page is:
    PAGE / HELLO_PAGE_GROUP / HELLO_PAGE / TAB37465 / TAB37469 /
    TAB37465 is the name of the tab attribute. I realized this and went to change the name of the tab to a more meaningful value. However, when I try to add the item, the page Path did not change. Is this a oracle internal bug?
    I have similar problem with navigation page. I published a navigation page as portlet. I changed the name of the navigation page and use the name as the portlet name, the new name of the portlet can not be reflected in the portlet repository.

    Jerry,
    1. I tried to add an item to the page within the tab. On the "add item" page, it shows me the path to the current page. Ok, Let's forget about "item", and just talk about the path to a tabbed page. The path/URL never changes, even after I change the tab "name" attribute.
    2. I am talking about the name of the portlet within portlet repository. Let's see within page group A, I created navigation page with name of "test". I published the page as a portlet. In the portlet repository, I can see a new portlet "test" under "new/A". I changed navigation page name from "test" to be "B", however, the portlet name never changed in the portlet repository. It's always "test".

  • Bug: SecondaryKey "name" attribute, cannot open DB after closing

    Welcome!
    I would like to report the following issue (version 3.3.74). Let us assume the MANY_TO_MANY Author-Book relation:
    @Entity
    public class AuthorEntity {
    bq. @PrimaryKey(sequence="authorSeq") \\ private long authorId;
    bq. @SecondaryKey(relate = MANY_TO_MANY, relatedEntity = BookEntity.class, name = "bookId", onRelatedEntityDelete = DeleteAction.NULLIFY) \\ private Set&lt;Long&gt; bookIds;
    bq. ...
    @Entity
    public class BookEntity {
    bq. @PrimaryKey(sequence="bookSeq") \\ private long bookId;
    bq. ...
    I wanted to name the variable "bookIds", not the "bookId" in the AuthorEntity (no major reasons). To achieve this, I have used the "name" attribute of SecondaryKey to point the appopriate member of BookEntity. The Javadoc documentation of SecondaryKey class states:
    public abstract String name
    Specifies the name of the key in order to use a name that is different than the field name.
    This is convenient when prefixes or suffices are used on field names. For example:
    +class Person {+
    bq. +     @SecondaryKey(relate=MANY_TO_ONE, relatedEntity=Person.class, name="parentSsn")+ \\ +     String m_parentSsn;+
    +}+
    It can also be used to uniquely name a key when multiple secondary keys for a single entity class have the same field name. For example, an entity class and its subclass may both have a field named 'date', and both fields are used as secondary keys. The name property can be specified for one or both fields to give each key a unique name.
    When I create the Environment for the first time, populate it with sample data, and try to add, find, remove the SecondaryKey works as it should. The appropriate id is being nullified. When I close the EntityStore, no error occurs. As I try to open it again I got the NullPionterException from checkSecKeyMetadata:
    Caused by: java.lang.NullPointerException
    bq. +     at com.sleepycat.persist.impl.ComplexFormat.checkSecKeyMetadata(ComplexFormat.java:1143)+ \\ +     at com.sleepycat.persist.impl.ComplexFormat.evolveFieldList(ComplexFormat.java:1428)+ \\ +     at com.sleepycat.persist.impl.ComplexFormat.evolveAllFields(ComplexFormat.java:1245)+ \\ +     at com.sleepycat.persist.impl.ComplexFormat.evolve(ComplexFormat.java:1019)+ \\ +     at com.sleepycat.persist.impl.Evolver.evolveFormatInternal(Evolver.java:440)+ \\ +     at com.sleepycat.persist.impl.Evolver.evolveFormat(Evolver.java:248)+ \\ +     at com.sleepycat.persist.impl.PersistCatalog.&lt;init&gt;(PersistCatalog.java:357)+ \\ +     at com.sleepycat.persist.impl.Store.&lt;init&gt;(Store.java:180)+ \\ +     at com.sleepycat.persist.EntityStore.&lt;init&gt;(EntityStore.java:165)+
    I have tried to check the database with DBVerify, and everything was fine.
    Regards,
    Lukasz Antoniak

    Hi Lukasz,
    Thank you very much for this bug report. You gave us exactly the information we needed and we have been able to reproduce the bug.
    Note that if you enable assertions (-ea) you'll see an assertion fire earlier than the NPE is throw. For example:
    java.lang.AssertionError
    at com.sleepycat.persist.impl.ComplexFormat.evolveFieldList(ComplexFormat.java:1327)
    at com.sleepycat.persist.impl.ComplexFormat.evolveAllFields(ComplexFormat.java:1245)
    at com.sleepycat.persist.impl.ComplexFormat.evolve(ComplexFormat.java:1019)
    at com.sleepycat.persist.impl.Evolver.evolveFormatInternal(Evolver.java:440)
    at com.sleepycat.persist.impl.Evolver.evolveFormat(Evolver.java:248)
    at com.sleepycat.persist.impl.PersistCatalog.<init>(PersistCatalog.java:357)
    at com.sleepycat.persist.impl.Store.<init>(Store.java:180)
    at com.sleepycat.persist.EntityStore.<init>(EntityStore.java:165)I'll post back here when this is fixed and we know the exact scope of the problem.
    A workaround for this problem is to remove the name property from the SecondaryKey annotation, as you probably already know.
    Thanks again,
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Bug? - Submitting page with html name attribute in content

    Hello,
    I use a modified version of Task Manager to track tasks in my group at work. I wanted a "non-standard" report to show the users the history of their task at the bottom of a page. Basically I created a PL/SQL function that returns preformatted HTML as I would like it to be displayed in a row of the report. The end result is great - a highly customized report layout with little effort.
    The problem is that recently a user copied and pasted some HTML from another web application into the body of a task and saved it. The next time the task was opened my report at the bottom displayed what they had entered previously. However, this time when the user clicked save and submitted the page, he got a page can not be displayed error. After a little digging, I found that the HTML the user had pasted previously contained an HTML element that had a name attribute. When I removed the name attribute, the page submitted fine which leads me to believe that the ApEx engine tried to bind the value of that item with an application item and it choked when no match was found - similar to the way it chokes if you submit a valid item that contains more than 32767 bytes of information.
    The fix for my situation is simple. I'll use regular expressions to find these name attributes when saving the page and strip them out. I only bring it up because it could possibly effect other users that might not be able to figure out what the problem is.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

    Dan,
    Part of the data stream being emitted to the page is:
    < input type="hidden" name="_ctl0:_ctl34:_ctl0:dgCriteria" value="_ctl0:_ctl34:_ctl0:dgCriteria" ...
    Since your report does not escape the data, it gets interpreted by the browser as HTML -- a form input item in this case. And yes, modplsql complains because that name cannot be bound to a PL/SQL input parameter in the form-handling procedure.
    The correct way to handle this generic problem (second-order cross-site scripting) is to always escape output to the browser unless you control the content from origin to the time it is emitted.
    Scott

  • ComplexType name attribute problem

    Hi! All
    I'm trying to make a schema of a WSDL file.Given below are the port types(interfaces exposed by a web service)definition of the services and the parterner link type definition.
    This is the port type definitions
    <!-- port type definitions -->
    <portType name="loanServicePT">
    <operation name="request">
    <input message="lns:creditInformationMessage"/>
    <output message="lns:approvalMessage"/>
    <fault name="unableToHandleRequest"
    message="lns:errorMessage"/>
    </operation>
    </portType>
    <portType name="riskAssessmentPT">
    <operation name="check">
    <input message="lns:creditInformationMessage"/>
    <output message="lns:riskAssessmentMessage"/>
    <fault name="loanProcessFault"
    message="lns:errorMessage"/>
    </operation>
    </portType>
    <portType name="loanApprovalPT">
    <operation name="approve">
    <input message="lns:creditInformationMessage"/>
    <output message="lns:approvalMessage"/>
    <fault name="loanProcessFault"
    message="lns:errorMessage"/>
    </operation>
    </portType>
    This is the partner link definitions
    <!--partner link type definitions -->
    <plnk:partnerLinkType name="loanPartnerLinkType">
    <plnk:role name="loanService">
    <plnk:portType name="lns:loanServicePT"/>
    </plnk:role>
    </plnk:partnerLinkType>
    <plnk:partnerLinkType name="loanApprovalLinkType">
    <plnk:role name="approver">
    <plnk:portType name="lns:loanApprovalPT"/>
    </plnk:role>
    </plnk:partnerLinkType>
    <plnk:partnerLinkType name="riskAssessmentLinkType">
    <plnk:role name="assessor">
    <plnk:portType name="lns:riskAssessmentPT"/>
    </plnk:role>
    </plnk:partnerLinkType>
    when a schema is generated the partner link type definitions is changed into a complexType
    <xs:cmplexType name="plnk:partnerLinkType">
    Now the error is that the name attribute takes in "NCName" type value and the value which is given to it while generating a schema is of "Qname" type.
    can any one please tell me how to change/what modifications are needed in the schema to correct it.
    (Or in other words how do we change a "QName" value to a "NCName")
    Please help is needed urgently.Any input will be highly appreciated.
    Many Regards
    Ved

    Set the namespace in the Schema instaed of the partner link type definition.
    Generate schema without the plnk prefix. Set namespace in Schema.

  • 0vendor is not displaying name attribute when I maintained master data.

    0vendor is not displaying name attribute when I maintained master data.
    Details: I have four records in the 0vendor infoobject (sand box). I have to show these four records to the client. As i have free hands I maintained master data in the name field and finally activated master data. But when I add the name attribute to the vendor charecteristic in the query designer; it is displaying name attribute as # . Any idea how to display the names of the four vendors in the zquery.
    Also do you know the transaction to copy standard query to Zquery?
    Thanks in advance.

    Dear Les
    For 0VENDOR, Set Property as Key & Text, try once again.
    Yes, you can copy the standard query very well.
    Open the Standard query & using SAVE AS, you can copy to "Z" queries.
    Hope, now you will get some idea
    Regards
    Saravanan.ar

  • Name Attribute for ITEM

    Hi :
    I need a help in defining the name attribute for items in html_db.items
    how to give the id for the items please any one suggest me
    i am using this way but its not working
    select
    HTMLDB.ITEM_TEXT(1,sysdate,20,20,"id=s_first")
    from
    dual
    thanks
    sudhir

    hi,
      That one previous workflow and it solved. But now the same one with loop for Re-submission of Leave Request after change.
      Actually the values from Employeet is not flowing in the Unlock step for agent determination. Because of that the agent determination is not possible for me. But it works well without loop scenario. Employeet is not instantiated.
    Here i am using loop condition for re-submission of leave request.
    Thanks,
    Balaji.V
    Edited by: Balajisap on Sep 19, 2011 3:56 PM
    Edited by: Balajisap on Sep 19, 2011 6:22 PM

  • HandlerChain annotation name attribute deprecated.

    Hi All,
    I am using @HandlerChain(file="HandlerConfig.xml") annotation to configure a SOAPMessageHandler in my Impl file. This annotation contains a deprecated "name" attribute. When I am not specifying "name" attribute in the annotation, JWSC task is throwing "Null Pointer Exception" while creating the war of the service. This is probably because the HandlerConfig.xml contains handler-chain-name element and the annotation doesn't contain "name" attribute. When I am specifying name attribute in the annotation everything is fine. Please help me in resolving the problem without "name" attribute.
    This is the code I am having:
    SubmitApplicationServiceImpl.java:
    package com.project.webservices.submitappservice;
    import javax.jws.WebService;
    import weblogic.jws.WLHttpTransport;
    import javax.jws.HandlerChain;
    **@HandlerChain(file = “SubmitAppHandlerChain.xml”)**
    @WebService(serviceName = "SubmitApplicationService", targetNamespace = "http://project.com/ SubmitApplicationService", endpointInterface = "com.project.webservices.submitappservice.SubmitApplicationServiceSoap")
    @WLHttpTransport(contextPath = "SubmitApplicationService", serviceUri = "SubmitApplicationService", portName = "SubmitApplicationServiceSoapSoapPort")
    public class SubmitApplicationServiceSoapImpl implements
              SubmitApplicationServiceSoap {
         public SubmitApplicationRes submitApplication(
                   SubmitApplicationReq submitApplicationRq) {
    // Our business logic here.
              return submitApplicationRes;
    This is my handler configuration file in the same package:
    SubmitAppHandlerChain.xml:
    <?xml version='1.0' encoding='UTF-8'?>
    <jwshc:handler-config xmlns:jwshc="http://www.bea.com/xml/ns/jws"
    xmlns="http://java.sun.com/xml/ns/j2ee" >
    <jwshc:handler-chain>
    <jwshc:handler-chain-name>HandlerChain</jwshc:handler-chain-name>
    <jwshc:handler>
    <handler-name>AppServiceHandler</handler-name>
    <handler-class>com.project.webservices.submitappservice.AppServiceHandler</handler-class>
    </jwshc:handler>
    </jwshc:handler-chain>
    </jwshc:handler-config>
    This is the build target that creates war of the service:
    <taskdef name="jwsc"
              classname="weblogic.wsee.tools.anttasks.JwscTask"
              classpathref="compile.classpath" />          
    <target name="create-appservice-war>
    <jwsc srcdir="${basedir}/project/src" destdir="${basedir}/projectEAR/build">
                   <jws file="com/project/webservices/submitappservice/SubmitApplicationServiceSoapImpl.java"/>
                   <classpath refid="jwsant.classpath" />
              </jwsc>               
    </target>
    Thanks,
    Satya

    The default value of the name() attribute for field-based Java EE environment annotations is
    <fully-qualified-name-of-declaring-class>/<field-name>. It's a bit ugly, but at least it's guaranteed
    to be unique :-)
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • NPS: Override User-Name and User Identity Attribute

    After configuring NPS and using http://technet.microsoft.com/en-us/library/dd197535%28WS.10%29.aspx it's possible to authenticate based on MAC Addresses.
    Is it by design that all authentication requests handled, are changed to MAC Address Authentication?
    We want to have three Network Access Policies, two based on Active Directory Account, one based on MAC Address.
    After entering the registry values and rebooting the server, it's only possible to authenticate based on MAC Address.
    Do we need seperate NPS servers, one for MAC based authentication and one for A.D. account authentication?
    Thank you in advance.

    Hi GerardVU4,
    Thank you for your post.
    Is it by design that all authentication requests handled, are changed to MAC Address Authentication?
    To always use the MAC address as the user identity, on the NPS server set the Override User-Name registry value to 1.
    If you set Override User-Name to 1 and the User Identity Attribute to 31, the authenticating server can perform
    only Automatic Number Identification/Calling Line Identification (ANI/CLI)-based authentication. Normal authentication by using authentication protocols, such as Microsoft Challenge Handshake Authentication Protocol (MS-CHAP) and Extensible
    Authentication Protocol (EAP), is disabled.
    So please remove Override User-Name registry entry on your NPS server first.
    Do we need separate NPS servers, one for MAC based authentication and one for A.D. account authentication?
    No, you could set up three Network Access Policies on same NPS server.
    Network Access Policies based on MAC Address, just select Authentication Methods PAP in policy Constraints TAB.
    Network Access Policies based on Active Directory Account, Keep the default Authentication Methods MS-CHAP-v2& MS-CHAP.
    If there are more inquiries on this issue, please feel free to let us know.
    Regards,
    Rick Tan

  • How to get the name and value of an attribute on a node/element that is not a child

    Hello,
    Can someone shed some wisdom on how I can compare 2 xml nodes for differences.
    My main challenge is I need to use the attributes/values of 'ProductDescription' and 'Features' as 'key' to identify the same node in
    another doc with the same layout, but different content.
    I am having trouble getting the name of the attribute on the node, 'ProductDescription' and 'Features'.  I can only seem to get the node names, but not the attributes on the node.  I need the name, because it can be different from doc to doc, so
    I can't hardcode this.
    Can someone please help with how to retrieve an attribute name/value on a node that is not a child.  Here's an example of what
    my xml looks like:
    DECLARE
    @myDoc1 xml
    ,@mydoc2 xml
    DECLARE
    @ProdID int
    SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <features featureID = "2" featureName = "seat">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>
    SET @myDoc2 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>2 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <features featureID = "2" featureName = "wheel">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>
    I need to compare the attributes of 'ProductDescription' and 'Features' from @mydoc1 against @mydoc2 to see if they are the same based on those 2 nodes first.  If they are, then i want to show the difference in the child elements. 
    This will eventually be an outer join to give me the differences betw the 2 docs based on those key values (node attributes).
    I used node('//*') for the path, and value('local-name(../.)', 'varchar(50)') as element
    ,value('.[not(@xsi:nil = "true")]','VARCHAR(255)') AS new_value
    ...etc...
    but that only gives me the node names, and the child elements.  It does not give me back the attribute names and values from the node itself.
    Thanks in advance for your help.
    cee

    Are you looking for something like this:
    DECLARE @myDoc1 xml
    SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <Features featureID = "2" featureName = "seat">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>'
    SELECT T.c.value('local-name(.)', 'nvarchar(50)') AS name,
           T.c.value('.', 'nvarchar(50)')  AS value
    FROM   @myDoc1.nodes('ProductDescription/@*') AS T(c)
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • Using shuffle on multiple machines

    Hi - I have a computer at work and home and I want to be able to have the songs that are on my ipod on both computers. When I connect it to my home computer (having had it running on my work one for some months) it wants to delete all the songs from

  • Paint a simple square in a pdf-document

    Hi, i have a simple question. How can i paint a simple white rectangle in a pdf-document? Backround is following: I wanne stamp a text in an arrea of my pdf. I dont know what is in that area. So it can happens i stamp my black letters on a black back

  • Newbie - how to change the color of a line using ActionScript?

    This must be the most basic question in the world, but I've been searching the documentation for an hour. All I want to do is to draw a line on the stage, and then change its color (or endpoint positions) dynamically using ActionScript. This is the 1

  • Need Optimized Solution to insert a table with 70 columns

    Hi, I need to insert almost 13 million records to a table which has 70 columns, and each column is a derived one.I have used the pl/sql tables to get all the 13 million records and process them, it takes 3 mins for 100 records. Any optimized solution

  • Zen Touch Touchpad Prob

    Anyone else experience a problem where the touchpad stops working for any amount of time. For no reason it stops working, either when i first turn it on, or while im using it. It wont scroll, it won't detect my touch... however the buttons still seem