Comments (4)
This is happening on a longer XML. Here is an excerpt of the XML:
<ad:feature key="PARTICULATE_FILTER_DIESEL" url="https://services.mobile.de/refdata/classes/Car/features/PARTICULATE_FILTER_DIESEL">
<resource:local-description xml-lang="de">Partikelfilter</resource:local-description>
</ad:feature>
<ad:feature key="AUTOMATIC_RAIN_SENSOR" url="https://services.mobile.de/refdata/classes/Car/features/AUTOMATIC_RAIN_SENSOR">
<resource:local-description xml-lang="de">Regensensor</resource:local-description>
</ad:feature>
The part with "Partikelfilter" works because I writeln it to the console, and then it bombs. But I can't see any problem...
from dxml.
This is the code:
// query specific model offers with details
auto http = HTTP();
http.method = HTTP.Method.get;
http.url = "https://sandbox.services.mobile.de/search-api/search?page.size=100&classification=refdata%2Fclasses%2FCar%2Fmakes%2FAUDI%2Fmodels%2FA6";
http.setAuthentication("search-generic", "search-generic");
http.addRequestHeader("Accept-Language", "de");
http.onReceive = (ubyte[] answer){
auto cars = parseXML(cast(char[])answer);
foreach(entity; cars){
version(log3) {
writeln(entity); // all XML
writeln("\t", entity.type);
if(entity.type == EntityType.elementStart || entity.type == EntityType.elementEnd) writeln("\t", entity.name);
}
if(entity.type == EntityType.elementStart && entity.name == "ad:ad") {
string adid;
entity.attributes.getAttrs("key", &adid);
write(adid);
}
if(entity.type == EntityType.text) writeln(" : ", entity.text);
}
return answer.length;
};
http.perform();
from dxml.
Interestingly, when I run the code several times, I can parse the received XML up to different places before I get the assert. But the returned XML is always the same.
from dxml.
Ok, and this led me to the problem: It's not dxml, I used the curl code wrong... sorry for the noise.
from dxml.
Related Issues (20)
- Utilize Phobos skipOver HOT 1
- Can't build => can't use HOT 7
- Convienience methods suggestions for DOM parser HOT 4
- dom: Entities consisting of whitespace do not capture their contents HOT 2
- Assert descriptions HOT 2
- Parsing xml without loading the whole file into RAM HOT 5
- parser.d(1925): [1:1]: Expected < HOT 2
- How to get position of end tag? HOT 1
- Can't get skipToPath work on real data HOT 1
- stripIndent removes text
- stripIndent removes any run of the "right" number of whitespaces HOT 2
- need a shorter way to reach attributes of Entities. HOT 1
- decodeXML does not compile when given a range of type char[] HOT 2
- Parser fails to operate on UTF8 Files containing a BOM HOT 1
- Compiling with GDC-10.3.0, invalid UTF characters
- Characters legal in XML 1.1 are not accepted
- Change writer.output to finish() HOT 3
- namespace support HOT 10
- Fuzz target for `parseXML` with 2 crashing testcases HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dxml.