This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dealing with namespaces in Nokogiri. | |
# | |
# First thing you must do is abandon what you're used to with Builder, | |
# namespaces aren't just attributes on an element, they uniquely identify | |
# what sort of element you are building and, as such, you are better off | |
# specifying them manually. | |
# | |
# The key here is accessing the Nokogiri::XML::Element being built with | |
# b.parent, then you can set the namespace (distinguished by an element | |
# with a prefix such as "soap12:Envelope") or add a default namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pre><?php | |
$var = "Not%c3%adcias"; | |
echo $var; | |
echo "\n"; | |
echo htmlentities($var); | |
echo "\n"; | |
echo urlencode($var); | |
echo "\n"; |