polyxml 0.14.2__tar.gz → 0.14.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. {polyxml-0.14.2 → polyxml-0.14.3}/Cargo.lock +5 -5
  2. {polyxml-0.14.2 → polyxml-0.14.3}/Cargo.toml +1 -1
  3. {polyxml-0.14.2 → polyxml-0.14.3}/PKG-INFO +1 -1
  4. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/codegen/rust/mod.rs +2 -1
  5. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/codegen/typescript/mod.rs +6 -2
  6. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_rust_codegen.rs +50 -0
  7. {polyxml-0.14.2 → polyxml-0.14.3}/pyproject.toml +1 -1
  8. {polyxml-0.14.2 → polyxml-0.14.3}/README.md +0 -0
  9. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/Cargo.toml +0 -0
  10. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/README.md +0 -0
  11. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/benches/core_benchmarks.rs +0 -0
  12. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/codegen/cpp/mod.rs +0 -0
  13. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/codegen/csharp/mod.rs +0 -0
  14. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/codegen/go/mod.rs +0 -0
  15. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/codegen/java/mod.rs +0 -0
  16. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/codegen/mod.rs +0 -0
  17. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/codegen/python/mod.rs +0 -0
  18. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/converters.rs +0 -0
  19. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/error.rs +0 -0
  20. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/ir/mod.rs +0 -0
  21. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/ir/tarjan.rs +0 -0
  22. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/json.rs +0 -0
  23. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/lib.rs +0 -0
  24. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/parser.rs +0 -0
  25. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/schema.rs +0 -0
  26. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/schema_parser/mod.rs +0 -0
  27. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/serializer.rs +0 -0
  28. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/transcoder.rs +0 -0
  29. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/src/value.rs +0 -0
  30. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_conformance.rs +0 -0
  31. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_core.rs +0 -0
  32. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_cpp_codegen.rs +0 -0
  33. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_csharp_codegen.rs +0 -0
  34. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_go_codegen.rs +0 -0
  35. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_java_codegen.rs +0 -0
  36. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_json.rs +0 -0
  37. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_python_codegen.rs +0 -0
  38. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_rust_codecs.rs +0 -0
  39. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_schema_ir.rs +0 -0
  40. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_security.rs +0 -0
  41. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_transcoder.rs +0 -0
  42. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-core/tests/test_ts_codegen.rs +0 -0
  43. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-python/Cargo.toml +0 -0
  44. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-python/README.md +0 -0
  45. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-python/src/lib.rs +0 -0
  46. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-python/tests/test_conformance.py +0 -0
  47. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-python/tests/test_generated_models.py +0 -0
  48. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-python/tests/test_json.py +0 -0
  49. {polyxml-0.14.2 → polyxml-0.14.3}/crates/polyxml-python/tests/test_polyxml.py +0 -0
  50. {polyxml-0.14.2 → polyxml-0.14.3}/python/polyxml/AGENT_GUIDE.md +0 -0
  51. {polyxml-0.14.2 → polyxml-0.14.3}/python/polyxml/__init__.py +0 -0
  52. {polyxml-0.14.2 → polyxml-0.14.3}/python/polyxml/compat/__init__.py +0 -0
  53. {polyxml-0.14.2 → polyxml-0.14.3}/python/polyxml/compat/xsdata.py +0 -0
  54. {polyxml-0.14.2 → polyxml-0.14.3}/python/polyxml/py.typed +0 -0
@@ -549,7 +549,7 @@ dependencies = [
549
549
 
550
550
  [[package]]
551
551
  name = "polyxml"
552
- version = "0.14.2"
552
+ version = "0.14.3"
553
553
  dependencies = [
554
554
  "criterion",
555
555
  "heck",
@@ -567,14 +567,14 @@ dependencies = [
567
567
 
568
568
  [[package]]
569
569
  name = "polyxml-c"
570
- version = "0.14.2"
570
+ version = "0.14.3"
571
571
  dependencies = [
572
572
  "polyxml",
573
573
  ]
574
574
 
575
575
  [[package]]
576
576
  name = "polyxml-cli"
577
- version = "0.14.2"
577
+ version = "0.14.3"
578
578
  dependencies = [
579
579
  "clap",
580
580
  "glob",
@@ -588,7 +588,7 @@ dependencies = [
588
588
 
589
589
  [[package]]
590
590
  name = "polyxml-js"
591
- version = "0.14.2"
591
+ version = "0.14.3"
592
592
  dependencies = [
593
593
  "napi",
594
594
  "napi-build",
@@ -598,7 +598,7 @@ dependencies = [
598
598
 
599
599
  [[package]]
600
600
  name = "polyxml-python"
601
- version = "0.14.2"
601
+ version = "0.14.3"
602
602
  dependencies = [
603
603
  "lexical-core",
604
604
  "polyxml",
@@ -3,7 +3,7 @@ resolver = "2"
3
3
  members = ["crates/polyxml-core", "crates/polyxml-python"]
4
4
 
5
5
  [workspace.package]
6
- version = "0.14.2"
6
+ version = "0.14.3"
7
7
  edition = "2021"
8
8
  rust-version = "1.80"
9
9
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyxml
3
- Version: 0.14.2
3
+ Version: 0.14.3
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -1046,6 +1046,7 @@ impl RustCodegen {
1046
1046
  }
1047
1047
  out.push_str(" _ => {}\n");
1048
1048
  out.push_str(" }\n");
1049
+ out.push_str(" }\n");
1049
1050
  }
1050
1051
 
1051
1052
  let elem_fields: Vec<_> = field_metas
@@ -1192,7 +1193,7 @@ impl RustCodegen {
1192
1193
  if !attr_fields.is_empty() {
1193
1194
  out.push_str("\n for attr in start.attributes() {\n");
1194
1195
  out.push_str(" let attr = attr?;\n");
1195
- out.push_str(" match std::str::from_utf8(attr.key.local_name().as_ref()).unwrap_or(\"\") {\n");
1196
+ out.push_str(" match attr.key.local_name().as_ref() {\n");
1196
1197
  for meta in &attr_fields {
1197
1198
  let _ = writeln!(out, " \"{}\" => {{", meta.field.xml_name);
1198
1199
  self.emit_attr_parse(out, &meta.field, &meta.rust_name, ir);
@@ -251,7 +251,9 @@ impl TypeScriptCodegen {
251
251
  match &f.type_ref {
252
252
  TypeRef::Named(target_qname) => {
253
253
  if target_qname != &s.qname {
254
- if let Some(TypeDef::Struct(dep_struct)) = ir.types.get(target_qname) {
254
+ if let Some(TypeDef::Struct(dep_struct)) =
255
+ ir.types.get(target_qname)
256
+ {
255
257
  visit(dep_struct, ir, visiting, visited, ordered);
256
258
  }
257
259
  }
@@ -259,7 +261,9 @@ impl TypeScriptCodegen {
259
261
  TypeRef::List(inner) | TypeRef::Boxed(inner) => {
260
262
  if let TypeRef::Named(target_qname) = inner.as_ref() {
261
263
  if target_qname != &s.qname {
262
- if let Some(TypeDef::Struct(dep_struct)) = ir.types.get(target_qname) {
264
+ if let Some(TypeDef::Struct(dep_struct)) =
265
+ ir.types.get(target_qname)
266
+ {
263
267
  visit(dep_struct, ir, visiting, visited, ordered);
264
268
  }
265
269
  }
@@ -448,3 +448,53 @@ fn test_rust_codecs_codegen() {
448
448
  assert!(!code_disabled.contains("pub fn from_json_str("));
449
449
  assert!(!code_disabled.contains("pub fn to_json_string("));
450
450
  }
451
+
452
+ #[test]
453
+ fn test_rust_attribute_codec_loop_syntax() {
454
+ let mut ir = SchemaIR::new().with_target_namespace("https://example.com/siri");
455
+ ir.add_type(TypeDef::Struct(StructDef {
456
+ qname: QName::new(Some("https://example.com/siri"), "Envelope"),
457
+ base_type: None,
458
+ is_abstract: false,
459
+ fields: vec![
460
+ FieldDef {
461
+ name: "version".into(),
462
+ xml_name: "version".into(),
463
+ namespace: None,
464
+ kind: FieldKind::Attribute,
465
+ type_ref: TypeRef::Primitive(PrimitiveType::String),
466
+ cardinality: Cardinality::optional_one(),
467
+ nillable: false,
468
+ default_value: None,
469
+ fixed_value: None,
470
+ documentation: None,
471
+ facets: None,
472
+ is_cycle_cut: false,
473
+ },
474
+ FieldDef {
475
+ name: "body".into(),
476
+ xml_name: "Body".into(),
477
+ namespace: None,
478
+ kind: FieldKind::Element,
479
+ type_ref: TypeRef::Primitive(PrimitiveType::String),
480
+ cardinality: Cardinality::required_one(),
481
+ nillable: false,
482
+ default_value: None,
483
+ fixed_value: None,
484
+ documentation: None,
485
+ facets: None,
486
+ is_cycle_cut: false,
487
+ },
488
+ ],
489
+ documentation: None,
490
+ }));
491
+
492
+ let codegen = RustCodegen::new(RustOptions {
493
+ emit_codecs: true,
494
+ ..Default::default()
495
+ });
496
+ let code = codegen.generate_module(&ir);
497
+ assert!(code.contains("for attr in start.attributes() {"));
498
+ assert!(code.contains("match attr.key.local_name().as_ref() {"));
499
+ assert!(code.contains("\"version\" => {"));
500
+ }
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "polyxml"
7
- version = "0.14.2"
7
+ version = "0.14.3"
8
8
  description = "High-performance, polyglot XML data-binding engine built in Rust"
9
9
  authors = [
10
10
  { name = "Bailey Nguyen", email = "bailey.tan.nguyen@gmail.com" }
File without changes