Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Delete an attribute
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
wsalesky  
View profile  
 More options Aug 14 2007, 4:15 pm
Newsgroups: mozilla.dev.tech.xforms
From: wsalesky <wsale...@gmail.com>
Date: Tue, 14 Aug 2007 20:15:07 -0000
Local: Tues, Aug 14 2007 4:15 pm
Subject: Delete an attribute
Hi,
I'm trying to delete an attribute from an element, but having no luck.
I'm about 99% confident that my xpath is correct, is this a bug?

Here is a short example of my code:
<xforms:repeat nodeset="instance('metadata')/mods:titleInfo"
id="titleInfo">
       <xforms:input ref="@displayLabel">
             <xforms:label  class="mods-label">Display Label: </
xforms:label>
       </xforms:input>
       <xforms:trigger class="delete" appearance="minimal">
              <xforms:label>remove</xforms:label>
                       <xforms:action ev:event="DOMActivate">
                             <xforms:delete nodeset="@displayLabel"
at="index('titleInfo')"/>
                       </xforms:action>
        </xforms:trigger>
</xforms:repeat>

relevant XML snippit:
<mods:mods>
       <mods:titleInfo type="abbreviated" authority="lcsh"
displayLabel="title">
           <mods:title>Sound and fury :</mods:title>
           <mods:subTitle>the making of the punditocracy /</
mods:subTitle>
           <mods:nonSort>the</mods:nonSort>
       </mods:titleInfo>
</mods:mods>

Thanks for your help,
-Winona


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Clark, John  
View profile  
 More options Aug 14 2007, 4:31 pm
Newsgroups: mozilla.dev.tech.xforms
From: "Clark, John" <CLAR...@ccf.org>
Date: Tue, 14 Aug 2007 16:31:05 -0400
Local: Tues, Aug 14 2007 4:31 pm
Subject: RE: Delete an attribute
Winona,

> I'm trying to delete an attribute from an element, but having no luck.
> I'm about 99% confident that my xpath is correct, is this a bug?

I believe that the problem is that you don't need the "at" attribute on
your delete.  In that context, the nodeset will have exactly one node
(the desired attribute); the "at" attribute may evaluate to a number
greater than one.  You generally want to use the "at" attribute with the
"index" function when you're selecting the currently indexed element
node from a repeat.

Take care,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.

Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Clark, John  
View profile  
 More options Aug 16 2007, 9:17 am
Newsgroups: mozilla.dev.tech.xforms
From: "Clark, John" <CLAR...@ccf.org>
Date: Thu, 16 Aug 2007 09:17:00 -0400
Subject: RE: Delete an attribute
Winona,

I'm responding to you and the mailing list; it looks like you may have
forgotten to include the mailing list with your response.

> Thanks for the suggestion, unfortunately removing the at
> attribute did not help. Also, I'm pretty sure I would need it
> as the attribute I'm trying to delete is located within a
> repeating nodeset. Any other thoughts? Has anyone else run
> into problems deleting attributes?

I constructed a sample form based upon your original message:

<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xf="http://www.w3.org/2002/xforms"
    xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:mods="tag:clar...@ccf.org,2007-08-16:mods"
    xmlns:ev="http://www.w3.org/2001/xml-events">
  <head>
    <title>Test of deleting an attribute</title>

    <xf:model id="m">
      <xf:instance id="metadata">
        <mods:mods>
          <mods:titleInfo type="abbreviated" authority="lcsh"
displayLabel="title">
            <mods:title>Sound and fury :</mods:title>
            <mods:subTitle>the making of the punditocracy
/</mods:subTitle>
            <mods:nonSort>the</mods:nonSort>
          </mods:titleInfo>
          <mods:titleInfo type="A" authority="B" displayLabel="C">
            <mods:title>some title</mods:title>
            <mods:subTitle>some subtitle</mods:subTitle>
            <mods:nonSort>some</mods:nonSort>
          </mods:titleInfo>
        </mods:mods>
      </xf:instance>
    </xf:model>
  </head>

  <body>
    <h1>Test of deleting an attribute</h1>

    <xforms:repeat nodeset="instance('metadata')/mods:titleInfo"
id="titleInfo">
      <xforms:input ref="@displayLabel">
        <xforms:label class="mods-label">Display Label: </xforms:label>
      </xforms:input>
      <xforms:trigger class="delete" appearance="minimal">
        <xforms:label>remove</xforms:label>
        <xforms:action ev:event="DOMActivate">
          <xforms:delete nodeset="@displayLabel"
at="index('titleInfo')"/>
        </xforms:action>
      </xforms:trigger>
    </xforms:repeat>
  </body>
</html>

This form seems to have the behaviour for which you were looking.  It
also works without the "at" attribute (and I still think that *not*
including the "at" attribute is the correct approach).  Can you see if
this form works with your version of the Mozilla Xforms Extension?  If
it does, then we may need more information to try to determine why your
actual form isn't working.

Take care,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.

Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Clark, John  
View profile  
 More options Aug 16 2007, 9:38 am
Newsgroups: mozilla.dev.tech.xforms
From: "Clark, John" <CLAR...@ccf.org>
Date: Thu, 16 Aug 2007 09:38:21 -0400
Local: Thurs, Aug 16 2007 9:38 am
Subject: RE: Delete an attribute
Winona,

> This form does not work with my version of the extension. I'm
> using .0.8.0.3, what version did you test this with?

I've been testing one of the recent nightly branch builds
(2007-08-09-03[0], to be precise).  I didn't think there had been any
fixes to the delete functionality, but apparently I was wrong.  It looks
like bug 387738[1] might be related to your problem.  You may want to
give a nightly branch build a try; I've found them to be pretty stable.
If you do, you probably want to go with the latest one[2].

[0]
ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2007-08-09-03-mozi
lla1.8/windows-xpi

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=387738

[2]
ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2007-08-16-04-mozi
lla1.8/windows-xpi

Take care,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.

Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google