I have an xml like this:
<person name="foo" gender = "male" />
I want to transform it to
<person id="foo" gender="male" />
Is there a way to do that using XSLT?
This is the model with it's validation:
[MetadataType(typeof(TagValidation))]
public partial class Tag
{
}
public class TagValidation
{
[Editable(false)]
[HiddenInput(DisplayValue = false)]
public int TagId { get; set; }
[Required]
[StringLength(20)]
[DataType(DataType.Text)]
public string Name { get; set; }
//...
}
Here is the view:
<h2>Create</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>Tag</legend>
<div>@Html.EditorForModel()</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
And here is what get's renderd:
<form action="/Tag/Create" method="post">
<fieldset>
<legend>Tag</legend>
<div><input data-val="true" data-val-number="The field TagId must be a number." data-val-required="The TagId field is required." id="TagId" name="TagId" type="hidden" value="" />
<div class="editor-label"><label for="Name">Name</label></div>
<div class="editor-field"><input class="text-box single-line" data-val="true" data-val-length="The field Name must be a string with a maximum length of 20." data-val-length-max="20" data-val-required="The Name field is required." id="Name" name="Name" type="text" value="" /> <span class="field-validation-valid" data-valmsg-for="Name" data-valmsg-replace="true"></span></div>
...
</fieldset>
</form>
The problem is that TagId validation gets generated althoug thare is no Required attribute set on TagId property. Because of that I can't even pass the client-side validation in order to create new Tag in db.
What am I missing?
How can I get the user ID with the user name with instagram API without user authentication? If I try users/search, it returns multiple research results, so how can I be sure that I get the result of exact user name only?
For example, following requests return multiple users having their usernames similiar to aliciakeys, I want to get only the data of the user with exact user name.
https://api.instagram.com/v1/users/search?q=aliciakeys&access_token=232967857.f59def8.c44c9e739efb4c52ab858bc84f420d00
I'm looking for same way to get an unique ID of every partition in Win OS.
Also for flash drives (SD cards, pendrives, etc.) connected to PC.
I think that after formatting they get an unique ID - like MAC, right?
Also I want to get other information of that partition - it's name, file system, size, etc.
Hi,
I need to transform the rows into columns for the similar ID's in oracle
e.g.
The following is the result I will get if i query my database
Col1 Col2 Col3
1 ABC Yes
1 XYZ NO
2 ABC NO
I need to transform this into
Col1 Col2 Col3 Col4 Col5
1 ABC Yes XYZ No
2 ABC NO NULL NULL
Someone please help me in solving this issue
Thanks,
Siv
I'm trying link 40 buttons to one event handler method and then do the
processing work from one method instead of 40. I know how to link it
but once I get there I don't know how to distinguish what button was
pressed. Does anyone know how to reference the button object sender id
or is there another way to solve this problem?
Any help would be greatly appreciated.
I have 3 textboxes in three different tab control and i want to generate textbox id like textbox plus concatenate the tab number
for(int i=0;i<3;i++)
{
<%: Html.TextBoxFor(e=>e.vcr_LinkName + i)%>
}
its not working but when i change it to
for(int i=0;i<3;i++)
{
<%: Html.TextBox("vcr_LinkName" + i)%>
}
it works fine. but i want to use textboxfor instead of textbox
Hi, I was testing some data in my tables of my database, to see if there was any error, now I cleaned all the testing data, but my id (auto increment) does not start from 1 anymore, can (how do) I reset it ?
Sorry for any mistake in English, and thanks for the attention.
i'm looking for a rails plugin for open id authentication.
I'm using restful-authentication
Can you tip me any plugin?
Do you know any tutorials for using these plugins?
thanks
<?php
/*
Plugin Name: Members
*/
function myFilter2($query)
{
if ($query->is_category)
{
$currently_listing_categories = $query->query_vars['category__in'];
print_r($currently_listing_categories);
}
}
add_filter('pre_get_posts','myFilter2');
?>
This plugin display the category ids when the url is not SEO friendly
http://domain.com/wplab/wpla4/?cat=4
. but when I turn on SEO
http://domain.com/wplab/wpla4/category/members/
the array is empty
how can I get the category id with SEO friendly urls
Due to target audience I am using .net cookieless sessions in auto-detect mode and time to time I get visitors redirected with cookiless session url like
domain.com/(S(jdhdghdghd))/default.aspx
Problem is, if I call this url after session expired .net will re-create it. What I want to find out is a way to force .net to create another session id instead of using the one that came with url.
Is it possible?
Here I have a stored procedure that inserts a row but how do you make it return the last inserted id without making another query
CREATE PROCEDURE [dbo].[spInsertCriteriaItem]
@GroupID int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
insert into CriteriaItem (CriteriaGroupID) VALUES(@GroupID)
--I don't want to make another query here
END
Is it possible to do this
I am trying to use the following code, but I always get an error that I can find little information about:
- (id)initWithNibName:@"MyRidesListView" bundle:nil {
if ((self = [super initWithNibName:@"MyRidesListView" bundle:nil])) {
// Custom initialization
}
return self;
}
Error:
expected identifier before 'OBJC_STRING' token
This seems like a simple method to be calling. This is for a UINavigationController.
Ideas?
I'm using clearance (http://wiki.github.com/thoughtbot/clearance) for authentication in my rails app. But I'm trying to figure out how to grab the user's ID in a view after logging in.
Any ideas?
prod
someTable
1
3
5
dev
someTable
1
2
5
Given the above schema, I would like to know how to frame an Xpath query that returns the children of the node whose id is "QA03", for example.
Many Thanks in advance
I have a form where users can add input fields with jQuery.
<input type="text" id="task" name="task[]" />
After submitting the form I get an array on PHP.
I want to handle this with the $.ajax() but I have no idea how to turn my <input>s to an array in jQuery.
Thanks in advance.
Hello,
Using rails3 new routing system, is it possible to change the default :id parameter
resources :users, :key => :username
come out with the following routes
/users/new
/users/:username
/users/:username/edit
...etc
I'm asking because although the above example is simple, it would be really helpful to do in a current project I'm working on.
Is it possible to change this parameter, and if not, is there a particular reason as to why not?
We deployed a VSTO addin for outlook 2003. After installing the addin one of the user's outlook crashes when a contact is opened, i.e, when ItemProperties of the contact are read.Some theses properties are read using MAPI.There is no exception being logged even though we have try/catch and logging in all methods.
The event log has following message
The description for Event ID 1000 from source Microsoft Office 11 cannot be found
Source : Microsoft Office 11
The following information was included with the event:
outlook.exe
11.0.8312.0
4a403990
msvcr80.dll
8.0.50727.3053
4889d619
0
0001500a
I have a page that has the following div structure:
<div id="name" class="class_name">
How would I style the class?
Like this?
#name .class_name
name .class_name
#name class_name
?
I'm trying to read an xml response from YQL:
$url = 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20woeid%3D%22'.$woeid.'%22';
if (!$xml=simplexml_load_file($url) )
{
//DO STUFF
}
This code works. Now i'm trying to put my application ID in the url string but I don't know how it should be done.
Thanks.
On an ASP.NET page, if the ASP.NET elements like <asp:Texbox ID="Textbox1"> appears in more than one place, are they the same Textbox object or are they different objects with the same name "Textbox1"? If the same, "why won't it cause any conflicts?"
E.G.
runat="server" Text='<%# Bind("Name") %'
runat="server" Text='<%# Bind("Name") %'
'
i am using this code to select the checbox from fieldset.
$("fieldset:has(input[type='checkbox'])")
its working fine on the filedset i have studentid's i need to get the student id's which ever textbox is selected on the fieldset?
can anybody help me out?
thanks
When I try to use layout_above to position a view above another view, it can't find the ID if it's not in the same XML file. I'm adding my XML files at run time but I still want to be able to position them relative to eachother. Any suggestions?
Hi,
For Sqilte3 C API, I would use sqlite3_last_insert_rowid. How to get this id when using ActiveRecord after insert a new record? I use following way to insert a new record :
Section.new |s|
s.a = 1
s.b = 2
#I expected the return value of save to be the last_insert_id, but it is NOT
s.save
end
Hi guys, i came across a scenario where giving a <script> element an "ID" would solve a problem easily. However, after reading about the script tag at w3schools and quirksmode, it seems doing so could have some unforeseen consequences. Has anyone come across any of these issues with modern browsers such as Chrome, Safari, FF3 up and IE 7 up?
Thanks