I want to pass XML as a string in an XML attribute.
<activity evt="<FHS>
<act>
<polyline penWidth="2" points="256,435 257,432 "/>
</act>
</FHS>" />
Here the "evt" attribute is the XML string, so escaping all the less-than, greater-than, etc characters by the appr...
How can I use Nokogiri with having html entities (like German umlauts) untouched?
I.e.:
# this is fine
node = Nokogiri::HTML.fragment('<p>ö</p>')
node.to_s # => '<p>ö</p>'
# this is not
node = Nokogiri::HTML.fragment('<p>ö</p>')
node.to_s # => '<p>ö</p>'
# this is what I need
node = Nokogiri::HTML.fragment('<p>ö</p>')
...
I'm trying to parse an XML file I get from an external source but am having problems because there are unencoded XML entities in the text nodes.
Essentially, I'm asking the same question as this, but for Perl instead of PHP.
<report>
<company>A & W</company>
<company>Some Other Company with a < in Inc.</company>
</report>
I...
Hello everybody,
I have two tables: A & B
B {
B1: Field1,
B2: Field2,
...
}
A
{
Children: List of B,
A1: Field1,
A2: Field2,
}
I want to retrieve "A" entities with related "B" entities like this:
DataContext.A.Select( a => new MySubset( A1 = a.A1, Children = a.Children.Select(b => b.B1).ToList())...
Is there any 'slimmer' alternative to the System.Web.HttpUtility.HtmlEncode/.Decode functions in .net 3.5 (sp1)? A separate library is fine.. or even 'wanted', at least something that does not pull in a 'whole new world' of dependencies that System.Web requires.
I only want to convert a normal string into its xml/xhtml compliant equival...
Sample Conversions
& -> `&`
> -> `>`
Any small library function that can handle this?
...
With Hibernate you can load your Entity classes as:
sessionFactory = new AnnotationConfiguration()
.addPackage("test.animals")
.addAnnotatedClass(Flight.class)
.addAnnotatedClass(Sky.class)
.addAnnotatedClass(Person.class)
.addAnnotatedCl...
I have my objects with their properties. Objects could change their structure: properties may be added/removed/changed. Objects could be absolutely dropped.
So object's metadata (description, classes, call them like you want :) )could be changed.
The database should store objects schemas and instances of these objects.
What's the best ...
What's going one here?
$string = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<album>
<img src="002.jpg" caption="wássup?" />
</album>
XML;
$xml = simplexml_load_string($string);
// $xmlobj = simplexml_load_file("xml.xml"); // same thing
echo "<pre>";
var_dump($xml);
echo "</pre>";
Error:
Warning: simplexml_...
Hello guys,
I am new here and got a question that is tricking me all day long.
I've made a PHP script, that reads a website source code through cURL, then works with DOMDocument class in order to generate a sitemap file.
It is working like a charm in almost every aspect. The problem is with special characters.
For compatibility reaso...
Hi guys,
I'm having some difficult with PHP DOM class.
I am making a sitemap script, and I need the output of $doc->saveXML() to be like
<?xml version="1.0" encoding="UTF-8"?>
<root>
<url>
<loc>http://www.somesite.com/servi&#xE7;os/redesign</loc>
</url>
</root>
or
<?xml version="1.0" encoding="UTF-8"?>
<ro...
Folks,
In a standard 3-tier architecture, where would you put your Linq2SQL dbml file?
Is your answer the same for a ado.net entity data model?
If the dbml file is in the middle tier, then do you have a data layer?
Regards,
Brett
...
I have three entities that must interact: User, SupportTicketand PhoneConversation. When someone calls in requesting help, the User should have a SupportTicket assigned to him, with a PhoneConversation assigned to the Ticked describing the call.
My question is: In what entity should I put the method CreatePhoneSupportTicket() that crea...
I'm working on filter that should transform an output with some stylesheet. Important sections of code looks like this:
PrintWriter out = response.getWriter();
...
StringReader sr = new StringReader(content);
Source xmlSource = new StreamSource(sr, requestSystemId);
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transforme...
In "DDD" what is the best patterns for handling different versions of your entities, e.g. Entities in a list vs the full object. I would like to avoid the overhead of getting properties I do not need when displaying the entities in a list
Would you have a separate entity type used in lists or just fill up your full entity type partially...
I have some XMLs that contain character hex codes, e.g. it like this:
<char hex="AB"/>
Now I want to xslt transform for display in the browser:
<xsl:value-of select="concat('&#x', /char/@hex, ';', '')"/>
However, the output in the browser is &#xAB; and not as I expected «
so the browser does not display the character for...
I currently have a complex entity relationship setup based on my data structure in sql server 2008.
What I'm trying to do I would think would be ridiculously simple but I'm pulling my hair out and have spent days trying to figure it out.
I have an Address and AddressType table which are joined on addressTypeID. There are 2 AddressType...
Quick question... When approaching something like an email address the immediate idea is to treat this as a value object.
If we have a number of entities though, say a customer, a contact, and a supplier that are referencing the same email address, it is conceivable that when we change a customer's email address we may want the custome...
I am working on an iPhone app, and in a particular view I need to load two different entities: One that will populate a UITableView, and another that will populate a UITextView.
Is it possible to fetch both properties using a single NSFetchedResultsController?
Or do I need to use two different NSFetchedResultsController?
Any ideas on...
Hi, i have a problem with some data i retrievied from db with linq.
When I try to access data I obtain the following exception:
System.ObjectDisposedException : The istance of ObjectContext was deleted and is not possible to use it again for action that need a connection.
This is the code:
using (ProvaDbEntities DBEntities =
new ProvaDb...